Skip to Content
0
Former Member
Apr 02, 2014 at 03:54 PM

Unwanted Database Lock when using CAF BO method 'update'

32 Views

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

Attachments

Debug.jpg (61.1 kB)
Database1.jpg (201.8 kB)
Database2.jpg (92.4 kB)