New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JPA support with EJB 2.1 CMT [SPR-2236] #6926
Comments
Erwin Vervaet commented A discussion between Juergen Hoeller and myself talking about this issue. Provides some background and some ideas Juergen has about possible ways to implement this. |
Juergen Hoeller commented More specifically, JPA EntityManager synchronization at present only works with Spring transaction synchronization being active - that is, Spring transaction demarcation. With plain EJB CMT, no Spring transaction synchronization is active - we'd have to fall back to plain JTA synchronization through the javax.transaction.TransactionManager. Which is what we should consider supporting as well - like we do for Hibernate. However, with JPA, no javax.transaction.TransactionManager is available right away - in contrast to Hibernate -, so it would have to be specified explicitly. Juergen |
Juergen Hoeller commented Waiting for further demand here: that is, people intending to use a JPA provider such as Hibernate EntityManager or TopLink Essentials with EJB CMT 2.1, with no Spring transaction management involved. This essentially just affects J2EE servers based on JDK 1.5 but without built-in EJB3/JPA support, such as WebLogic 9.0 and WebSphere 6.1. We also need to see whether the mainstream JPA providers themselves properly support such an environment, regarding JTA cache synchronization (which they must care for internally) etc. One issue that comes to my mind here is that JPA providers are built on JTA 1.1, as included in Java EE 5, so there might be general issues hiding. Note that this issue is not relevant when using Spring's own transaction management, whether with local or with JTA transactions. It's only the JPA provider itself that needs to internally perform special synchronization with the underlying JTA environment there. Juergen |
Stig Kleppe-Jørgensen commented I'm not sure it will accelerate anything, but we have a need for a solution to this problem; running on WebSphere 6.1 and hoping to use JPA with the help of Spring. Regards, |
Juergen Hoeller commented This doesn't have priority at present, since JPA-JTA interaction should work fine with Spring-managed transactions (using Spring's JtaTransactionManager or any other JTA-aware PlatformTransactionManager). If there are any problems with that scenario, please create a separate JIRA issue with the specific details. I'll keep this open as enhancement request for direct integration with EJB CMT / plain JTA transactions, with no Spring PlatformTransactionManager involved. Juergen |
Juergen Hoeller commented There are currently no plans to proceed with this, since JPA support works fine with Spring-managed transactions (which can of course be backed by JTA) - and there haven't been many inquiries for this to work with raw EJB 2.1 CMT. Juergen |
Erwin Vervaet opened SPR-2236 and commented
It is currently not possible to have a local JPA EntityManager, like the one created by LocalEntityManagerFactoryBean, participate in JTA transactions managed by the container, e.g. EJB 2.1 CMT, even when using JtaTransactionManager.
The Spring Hibernate integration does support this, using the JtaTransactionManager.
As an aside, note that the Spring JDO support also does not support this.
Attachments:
Issue Links:
The text was updated successfully, but these errors were encountered: