jta

Data are not visible at support transation block

假装没事ソ 提交于 2019-12-12 00:25:14
问题 My method calls are like follow. @TransactionAttribute(TransactionAttributeType.SUPPORTS void M1() { M2(); M3(); } @TransactionAttribute(TransactionAttributeType.REQUIRED) void M2(){ //saving x on data base } @TransactionAttribute(TransactionAttributeType.SUPPORTS) void M3(){ //accessing x from data base } The issue is, some times value x is unavailable at method M3. Can any body say whats the possible issue here ? 回答1: There are two cases in your example, result is depending on whether is

Using Nativequery to delete/update records in JTA

社会主义新天地 提交于 2019-12-11 20:22:46
问题 I was stuck in very hard situation for a moment. The problem is: I have to use NativeQuery to delete and/or update some DB records in a JTA context (EJB). my JPA persistence.xml looks like: <persistence-unit name="OzsscJPANBPU" transaction-type="JTA"> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <jta-data-source>jdbc/postgres_ozssc</jta-data-source> <mapping-file>com/longz/ozssc/model/PostcodeEntity.xml</mapping-file> <class>com.longz.ozssc.model.CustomerEntity</class>

java.lang.NoClassDefFoundError: javax/persistence/Converter Exception using hibernate with tomee and maven

倖福魔咒の 提交于 2019-12-11 19:23:18
问题 I have the following exception: org.apache.openejb.OpenEJBException: Creating application failed: /home/mmarnc/apache-tomee-webprofile-1.7.1/webapps/name_vorname: javax/persistence/Converter at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:896) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:623) at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1248) at org.apache.tomee.catalina

How to set up Spring Boot + Bitronix + non-XA Datasource + XA JMS Connection

北城以北 提交于 2019-12-11 12:36:45
问题 I'm trying to set-up Bitronix in Spring Boot to use last resource gambit with non-XA datasource. Of course by default (autoconfiguration) data source does not participate in XA transaction. It seems that org.springframework.boot.jta.XADataSourceWrapper will work only for XADataSource . How to connect DataSource with Bitronix? 回答1: Bitronix uses its LrcXADataSource to implement the last resource gambit. You need to tell Spring Boot to create an XAResource of that type: spring.datasource.xa

Within JTA transaction (using container managed transaction), executeUpdate mehtod for explicit Query does immediate commit

做~自己de王妃 提交于 2019-12-11 11:16:48
问题 Within JBOSS 7.1 AS, I'm using container managed transaction. For each request, I do several entity updates. Most of the entities use "insert, merge, refresh" methods from EntityManager to manage the updates. However, there is one entity that uses explicit Query to do "executeUpdate" on the DB (see below for the code snippet). This sql update is immediately commited to the DB and it is not aligned with container managed transaction (like other entity updates). Is there anyway align explicit

Glassfish: JTA/JPA transaction not rolling back

╄→гoц情女王★ 提交于 2019-12-11 07:54:53
问题 I am running Glassfish 3.1.1 with an Oracle database and have run into an issue with transactions not rolling back, but only on one specific environment so far. The same application works as expected on other machines. However, two separate Glassfish domains on the same machine are impacted. Within the affected environment, I have similar results with both a container-managed transactions (CMT) inside an EJB that throws a RuntimeException, and a bean-managed transaction (BMT) with

How to wrap an object change in my own transaction and incorporate it with Hibernate to JTA?

六月ゝ 毕业季﹏ 提交于 2019-12-11 07:29:54
问题 I have a web-app, which I deploy on Tomcat 6 and it uses Hibernate. It receives messages on a JMS queue which trigger changes both to my DB, via Hibernate and to an Object of mine ( Agent ). The web-requests also access the DB, via Hibernate, and access the shared object (there's a ConcurrentHashMap<AgentId,Agent> held by a singleton). My problem is that I have a JMS message which changes several different Agent s and several tables and I need the changes in the Agent s to be available if and

Can I roll back a JTA transcation after I commit it?

浪子不回头ぞ 提交于 2019-12-11 06:38:39
问题 I have a JTA transcation which I commit. Can I roll it back after I commit? If yes, how? I have following situation. I have a backend layer which updated 3 DBs. I have used JTA user transcation for it. If update in any DB fails all updates to 3 DBs are rolled back using utx.rollback Now I have a layer on top of backend layer which updates some other DB. Now I want that step 1 and step 2 should both succeed or both fail, so I want to roll back JTA transcation of step 1 in case step 2 fails. It

Spring Integration JMS with JTA rollback when message goes to errorChannel

老子叫甜甜 提交于 2019-12-11 06:16:25
问题 I am using Spring Integration with JTA support through Atomikos and JMS bound to different Webshpere MQ both inbound and outbound. The flow is the following: JMS inbound channel adapter receive the message some transformations JMS outbound channel adapter to the output queue when an error occurs, the errorChannel receives the message exception type router routes unhandled errors to a custom rethrow service and handled ones to a recipient-list-router that sends them to 2 error queues My

Glassfish 4 JDBC Resource connection fails with Hibernate 4.3.5 and JPA 2.1 connection allocation refused due to database “null”

烈酒焚心 提交于 2019-12-11 05:56:59
问题 I'm quite new to Java EE, and I have set up a project using NetBeans 8.0. In my EAR project, I created a JDBC DataSource and ConnectionPool which are successfully deployed to the Glassfish server upon deployment. When I try to connect I am using JPA 2.1 with Hibernate 4.3.5 and I am using the JTA jta-data-source entry in my persistence.xml file to name the managed resource. My persistence.xml file is as follows: <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.1" xmlns="http:/