LockAcquisitionException on concurrent client creation - remove need for 'max_child_count'

Description

Hello,

While creating the clients using Jmeter, i got the exception called org.hibernate.exception.LockAcquisitionException.

Environment

None

Activity

Show:
Raghavendra Bhandari
June 3, 2010, 6:02 AM

I Executed the test with different centers,but again i am getting the same issue.
For the first test 9 clients being inserted,and in the 2nd test 6 clients being inserted out of 10.

These are the testing Data = These are the branch name / center / group information

07:01:165:0304,3833,1272,TempClient2A,B = Banashankari-07:01 /Eliyaz Nagara 15 /07:01:165:0304
07:01:165:0102,3833,1272,TempClient2B,B = Banashankari-07:01 /Eliyaz Nagara 15 /07:01:165:0102
07:01:87:0304,152,2134,TempClient2C,B = Banashankari-07:01 /Yarab Nagara {H P S } /07:01:87:0304
07:01:87:0102,152,2134,TempClient2D,B = Banashankari-07:01 /Yarab Nagara {H P S } /07:01:87:0102
07:01:82:0304,147,2134,TempClient2E,B = Banashankari-07:01 /yarub nagara {B} /07:01:82:0304
07:01:82:0102,147,2134,TempClient2F,B = Banashankari-07:01 /yarub nagara {B} /07:01:82:0102
07:01:42:0304,107,891,TempClient2G,B = Banashankari-07:01 /Sarabandepalya M /07:01:42:0304
07:01:42:0102,107,891,TempClient2H,B = Banashankari-07:01 /Sarabandepalya M /07:01:42:0102
07:01:126:0304,39,2134,TempClient2I,B = Banashankari-07:01 /Eliyaznagar 11 /07:01:126:0304
07:01:126:0102,39,2134,TempClient2J,B = Banashankari-07:01 /Eliyaznagar 11 /07:01:126:0102

keithwoodlock
June 3, 2010, 10:15 AM

Raghavendra,

for now, can you just execute a test that creates one client per hierarchy so

center x1
+ group1
++ client1a
center x2
+ group2
++ client2a
center x3
+ group3
++ client3a
center x4
+ group4
++ client4a
center x5
+ group5
++ client5a

Raghavendra Bhandari
June 3, 2010, 11:49 AM
Edited

Keith,
Yes, it works.

I took 5 centers and execute the test for 5 clients, and then i have taken 10 different centers and execute the test for 10 clients, both the tests went fine with no errors/issues.

keithwoodlock
June 3, 2010, 12:32 PM

Thanks Raghavendra,

I think its fine to leave your 'client creation' script like this for now. There is a design problem with customers around max_child_count which creates the need to update the parent customer during creation which ultimately is causing the trouble with 'locks'.

At present this isn't a real issue for day-to-day use of the application due to the business process application users have for data-entry so i think we can close this issue and maybe create an 'improvement' issue around removing need for 'max_child_count'.

Lets see what Jeff thinks.

Jeff Brewster
June 3, 2010, 5:41 PM

Raghav, thanks for running those scenarios, this was very helpful.

Based on that information and conversation with Keith, going to change this to an improvement and change release target. Seems unlikely actual users will encounter many lock errors on the same group as a load test does.

[10:16] <jbrewster> keithw_: hi keith, question on issue MIFOS-2970. Can you help me understand why the LockAcquisitionException only started showing up on the head? Is 'max_child_count' new to Mifos?
[10:21] <keithw_> jbrewster: max_child_count has always been there. its is used when generating search_id for customers. since the refactoring we now have customer creation services that are 'atomic', previously this was not the case so i believe this wasnt showing before. so when we create new client, we must update its parents max_child_count to keep search_id creation someway sane, this used to happen...
[10:21] <keithw_> ...before but (although might not of in places)
[10:22] <keithw_> jbrewster: so if clients are created concurrently under the same parent, its likely that a 'lock' can occur if a previous transaction hasn't finished
[10:26] <jbrewster> keithw_: ok, thanks. and in this case under the same parent means under the same center. (as opposed to group) If a MFI had turned off centers, then in theory the same issue would occur if concurrent clients were created in the same group and transactions hadn't finished?
[10:28] <keithw_> jbrewster: in a center->group-> hierarchy, when creating clients, the group max_child_count is update so lock should happen there and possibly on center if something is updated there also, in group->client heirarchy, the same thing is true for groups
[10:35] <jbrewster> keithw_: ok, thanks. I'm ok with making this an improvement. Instead of closing/creating a new issue I'm going to convert the existing issue since it's got context. I'll also modify the summary

Assignee

mifosdeveloperqueue

Reporter

Raghavendra Bhandari

Labels

None

Implementation Priority

None

URL

None

Story Points

None

Team

Core

Scheduled For

None

Epic

None

productboard URL

None

Man Day Estimate

None

Components

Fix versions

Priority

Trivial
Configure