cancel
Showing results for 
Search instead for 
Did you mean: 

Unwanted Database Lock when using CAF BO method 'update'

Former Member
0 Kudos

Hi all

We are using the Composite Application Framework (CAF), and Business Objects (BOs) to save data on the database. A service call is using a BO ‘Update’ method as follows:


_location.debugT("Test debug line 4");

getBOSalesDataService().update(salesData);

_location.debugT("Test debug line 5");

The same method is then called by another service, while the first service is still active. It does not error, but it waits until the first service has timed out. You can see this from the following screenshot:

I think this is because the first service sets a lock on the SQL database. This is not an explicitly coded lock, but a database lock. I’ve tried using the following statement:


getBOSalesDataService().unlock(salesData.getKey(), IBusinessObjectNodeServiceBase.MODE_WRITE);

It doesn’t work. I think this because the lock was not created by a ‘lock’ statement. Are there any other statements I can use to commit
all database updates? If it was ABAP, I would use a ‘COMMIT WORK’, is there a Java / CAF equivalent?

I have spoken to our Basis consultants, they have shown me Solution Manager where we can actually see the locks happening. Session ID 53
is the first update, 54 is the second.

Thanks

Iwan

Accepted Solutions (0)

Answers (2)

Answers (2)

ch_loos
Product and Topic Expert
Product and Topic Expert
0 Kudos

For updates you actually need a lock to avoid inconsistencies.

the lock should automatically be released when the JTA transaction is completed - in the case of CMP EJBs when the first service is finished...

former_member191643
Active Contributor
0 Kudos

Wrong place to post this question buddy.

Former Member
0 Kudos

Happy to move it, but the Composite Applications space is closed for new messages, and the front page says "This space will be Merged with Business Process Management & Composition".