I have a server-side DMI method which executes two DSRequests that should be executed in the same transaction. But it seems they don't, since I get a DB deadlock and the logs tell me that these two requests use a different connection!!!!
My DSRequests are:
These are basically two delete requests. As you see, they share a RPCManager, but in the logs, I see the following:
These two requests are being executed using two different connections: '890193153' and '758550353'. How can this be true if they share the same transaction ?
Using smartgwt 5.0p power 2015-09-20
My DSRequests are:
Code:
DSRequest relDeleteRequest = new DSRequest(
KidsDataSources.REL_SCHUELER_ELTERN.getDataSourceId(),
DataSource.OP_REMOVE, rpcManager);
relDeleteRequest.setCriteria("f_eltern_id", elternId);
relDeleteRequest.execute();
DSRequest elternDeleteRequest = new DSRequest(
KidsDataSources.ELTERN.getDataSourceId(), DataSource.OP_REMOVE,
rpcManager);
elternDeleteRequest.setCriteria("f_id", elternId);
elternDeleteRequest.execute();
Code:
=== 2015-12-26 15:27:03,520 [ec-3] INFO SQLDataSource - [builtinApplication.null] Performing remove operation with
criteria: {f_eltern_id:8919} values: {f_eltern_id:8919}
=== 2015-12-26 15:27:03,521 [ec-3] DEBUG SQLConnectionManager - [builtinApplication.null] Borrowed connection '890193153'
=== 2015-12-26 15:27:03,521 [ec-3] DEBUG SQLDriver - [builtinApplication.null] About to execute SQL update in 'SQLSERVER' using connection'890193153'
=== 2015-12-26 15:27:03,521 [ec-3] INFO SQLDriver - [builtinApplication.null] Executing SQL update on 'SQLSERVER': DELETE FROM t_rel_schueler_eltern WHERE (t_rel_schueler_eltern.f_eltern_id=8919)
=== 2015-12-26 15:27:03,527 [ec-3] DEBUG SQLDataSource - [builtinApplication.null] remove operation affected 1 rows
=== 2015-12-26 15:27:03,527 [ec-3] INFO SQLDataSource - [builtinApplication.null] primaryKeys: {f_eltern_id=8919}
=== 2015-12-26 15:27:03,527 [ec-3] DEBUG DSRequest - About to free up resources for request of type remove on DataSource relSchuelerEltern
=== 2015-12-26 15:27:03,527 [ec-3] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
=== 2015-12-26 15:27:03,527 [ec-3] DEBUG AppBase - [builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
=== 2015-12-26 15:27:03,527 [ec-3] DEBUG AppBase - [builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
=== 2015-12-26 15:27:03,528 [ec-3] INFO SQLDataSource - [builtinApplication.null] Performing remove operation with
criteria: {f_id:8919} values: {f_id:8919}
=== 2015-12-26 15:27:03,528 [ec-3] DEBUG SQLConnectionManager - [builtinApplication.null] Borrowed connection '758550353'
=== 2015-12-26 15:27:03,528 [ec-3] DEBUG SQLDriver - [builtinApplication.null] About to execute SQL update in 'SQLSERVER' using connection'758550353'
=== 2015-12-26 15:27:03,528 [ec-3] INFO SQLDriver - [builtinApplication.null] Executing SQL update on 'SQLSERVER': DELETE FROM t_eltern WHERE (t_eltern.f_id=8919)
=== 2015-12-26 15:27:03,529 [ec-3] DEBUG SQLDataSource - [builtinApplication.null] remove operation affected 1 rows
=== 2015-12-26 15:27:03,529 [ec-3] INFO SQLDataSource - [builtinApplication.null] primaryKeys: {f_id=8919}
=== 2015-12-26 15:27:03,529 [ec-3] INFO DSResponse - [builtinApplication.null] DSResponse: List with 1 items
Using smartgwt 5.0p power 2015-09-20
Comment