openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prabhat (Created) (JIRA)" <>
Subject [jira] [Created] (OPENJPA-2155) Transaction Management in multiple Entities in one transaction
Date Fri, 16 Mar 2012 15:09:38 GMT
Transaction Management in multiple Entities in one transaction

                 Key: OPENJPA-2155
             Project: OpenJPA
          Issue Type: Question
          Components: jpa
    Affects Versions: 2.1.1
         Environment: WebSphere Application Server 6.1.37 on Windows and AIX
            Reporter: Prabhat

I am a new user on OpenJPA,
I have a scenario where I need to perform update/insert in multiple entities on one transaction.
How to achieve this?

example of EntityManager update method (auto generated by Rational Software Architect8.0.3).
[ The same way, I have two more entities. ]
	public String updateKna1(Kna1 kna1) throws Exception {
		EntityManager em = getEntityManager();
		try {
			kna1 = em.merge(kna1);
		} catch (Exception ex) {
			try {
				if (em.getTransaction().isActive()) {
			} catch (Exception e) {
				throw e;
			throw ex;
		} finally {
		return "";

If I keep commit/rollback in each entity then I can not rollback from all previous entities
(if last entity insert or update fails).

Can you help me on this?

Thanks in Advance.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message