[JBoss JIRA] Created: (JBPM-901) change to JTA transaction configuration
by Tom Baeyens (JIRA)
change to JTA transaction configuration
---------------------------------------
Key: JBPM-901
URL: http://jira.jboss.com/jira/browse/JBPM-901
Project: JBoss jBPM
Issue Type: Task
Components: Core Engine
Reporter: Tom Baeyens
Assigned To: Tom Baeyens
Fix For: jBPM jPDL 3.2
change from CMT to JTA transaction configuration to enable both the EJBs and the webapp to leverage the same JbpmConfiguration.
For this I created a new persistence service called JtaDbPersistenceService. It verifies that there is an active UserTransaction during the JbpmContext block. If not, one is created and ended in the jbpmContext.close. So now in the EJBs (CMT) there is already a transaction in progress and the JtaDbPersistenceService will not do anything. For the webapp, there will not be a user transaction and hence JtaDbPersistenceService will begin and end the user transaction.
This approach was needed because hibernate doesn't support beginning and ending of user transaction.
regards, tom.
--
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
19 years, 2 months
[JBoss JIRA] Commented: (JBAS-1098) Foreign key violation during cascade delete
by Alexey Loubyansky (JIRA)
[ http://jira.jboss.com/jira/browse/JBAS-1098?page=comments#action_12356021 ]
Alexey Loubyansky commented on JBAS-1098:
-----------------------------------------
It is rejected because setting foreign keys to null before cascade-delete was the intended behavior in the original implementation. And now we don't invest in CMP2.x anymore. The batch-cascade-delete does work with multiple levels.
> Foreign key violation during cascade delete
> -------------------------------------------
>
> Key: JBAS-1098
> URL: http://jira.jboss.com/jira/browse/JBAS-1098
> Project: JBoss Application Server
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: CMP service
> Affects Versions: JBossAS-3.2.6 Final
> Reporter: SourceForge User
> Assigned To: Alexey Loubyansky
> Fix For: No Release
>
>
> SourceForge Submitter: sflexus .
> JBoss 3.2.5, JDK 1.4.2_04, Linux.
> I have CMP Entity Customer and CMP entity Album with
> the following relationships:
> 1) 1 Customer has Many Albums
> 2) 1 Customer has 1 Album "Inbox"
> 3) 1 Customer has 1 Album "Private"
> 4) 1 Customer has 1 Album "Recycle Bin"
> So basically there are 3 Albums each of which has double
> relationship to Customer, both 1-1 and 1-M
> Relationship (1) has cascade-delete on Album side, so if
> customer is deleted, all his albums should be deleted.
> Relationships (2)-(4) has NO cascade-delete setting,
> since (1) should be enough, as it references ALL
> customer's albums, including those referenced in (2)-(4).
> There are other entities related to Customer in the
> application, but they seem non-important (at first sight).
> If I try to remove Customer instance, I get foreigh key
> violation in the database. All foreign keys were created
> by JBoss itself. I have attached TRACE-level log. What
> happens is that all 3 albums (inbox, private and recycle
> bin, their IDs are 162, 163 and 164) are scheduled for
> cascade delete, but only the one with ID=164 is updated
> to set its CMR column to NULL before issuing DELETE
> FROM Customer SQL. The foreign key fk_album_owner
> which is being violated corresponds to relation (1) "1
> Customer has Many Albums".
> The interesting thing is that if I redeploy the application
> and issue remove again, it completes normally! Looks like
> it depends on some cache state.
> Two files are attached. First one demonstrates foreign
> key violation, second one demonstrates success deletion
> after application is redeployed.
--
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
19 years, 2 months