by
207 11
0
5
1,484
0
Top 1% !
Famous
Easy-to-find
Specified
OpenSource
Popularity: 17724th place
Architecturex86_64
JVMjre8
OSWindows

EntityManager joining a JTA transaction

EntityManager joining a JTA transaction
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/1392413/EntityManager-joining-a-JTA-transaction?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
EntityManagerFactory emf = Persistence.createEntityManagerFactory("foo_PU"); EntityManager em = emf.createEntityManager(); // specific to JBossStandAloneJtaPlatform javax.transaction.TransactionManager tx = com.arjuna.ats.jta.TransactionManager.transactionManager(); // or javax.transaction.UserTransaction tx_ = com.arjuna.ats.jta.UserTransaction.userTransaction(); try { tx.begin(); em.joinTransaction(); em.persist(transientInstance); tx.commit(); ...
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus