[jboss-jira] [JBoss JIRA] Created: (JBAS-3832) CMR Relationships not updated after rollback
Jay Perkins (JIRA)
jira-events at jboss.com
Mon Nov 6 12:03:41 EST 2006
CMR Relationships not updated after rollback
--------------------------------------------
Key: JBAS-3832
URL: http://jira.jboss.com/jira/browse/JBAS-3832
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: CMP service
Affects Versions: JBossAS-4.0.4.GA
Environment: Windows XP Professional Version 5.1 Service Pack 2
Reporter: Jay Perkins
Assigned To: Alexey Loubyansky
After alot of research, I have come to the following conclusion. Performing a rollback does not rollback any changes made to a CMR relationship altered in concurrent transactions. The changes made to the database seem to be rolled back, but the entity that contains the CMR relationship will still contain the association.
Entity of type A has one to many relationship with Entity of type B
Start Transaction 1
Load Entity A1
Create Entity B1
Add Entity B1 to Entity A1 CMR relationship
Suspend Transaction 1
Start Transaction 2
Create Entity B2
Add Entity B2 to Entity A1
Rollback Transaction 2
Resume Transaction 1
Call CMR relationship to get B entities from A1
Returns RelationSet with 2 Entities
Get NoSuchObjectLocalException when accesing CMP field from entity B2 found in the returned RelationSet because the creation of B2 was rolled back but the relationship between A1 and B2 still existed in memory.
Conclusion:
The CMR relationship is not being cleaned up when Transaction 2 is rolled back. Transaction 1
will get a RelationSet that contains a reference to the rolled back entity B2.
If you use the per transaction entity instance cache (to jboss.xml below)
<instance-cache>org.jboss.ejb.plugins.PerTxEntityInstanceCache</instance-cache>
You will avoid the problem because each transaction is working on a separate instance
of the entity. However, this is not a real workaround, because a side effect is that you also would not see commits
that occurred in transaction 2, within transaction 1.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list