jta

OpenJPA - Transaction management is not available… (Fuse ESB)

你离开我真会死。 提交于 2019-12-21 20:39:02
问题 I'm having trouble with RESOURCE_LOCAL transaction type for JPA in Fuse ESB. I also don't have a complete understanding of whether JTA or RESOURCE_LOCAL is better for me. My persistence.xml : <persistence-unit name="invoicePersistence" transaction-type="RESOURCE_LOCAL"> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider> <jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/invDataSource)</jta-data-source> <non-jta-data-source>osgi:service

XA/JTA transaction: JMS message arrives before DB changes are visible

 ̄綄美尐妖づ 提交于 2019-12-21 12:45:30
问题 Context is: producer (JTA transaction PT ) is both sending message to JMS queue and making DB update; consumer (JTA transaction CT ) listens on same queue and reads DB when message is received; application server - WebLogic, DB - Oracle. I've observed, that sometimes CT is not (yet?) able to see DB changes of PT , event if corresponding JMS message is already received ( PT is committed?). It seems that JTA can't guarantee consistency of such kind (this was also confirmed in Jurgen Holler's

when to use global transaction Or use spring aop for transaction

最后都变了- 提交于 2019-12-21 05:40:09
问题 Q1. i do understand when we need to deal with multiple databases, we need to use global transaction. but from this post http://fogbugz.atomikos.com/default.asp . the person suggested just use spring aop to advise on the different transactionmanager ( more > datasource/sessionfactory). can anyone explain in what kind of situation we can just use this approach And In what kind of situation do we need XA (global transaction) with atomikos or jotm or ejb..etc 回答1: If you are referring to this

use JTA transaction or not?

非 Y 不嫁゛ 提交于 2019-12-21 04:27:38
问题 I am developing a J2EE application which is deployed on JBoss application server. The application is composed of an EJB 2.x component and a web component and is running on local computer or remote server. The database is either Oracle or SQL Server and is not in a distributed envrionment. I am using Hibernate 3.6 (JPA 2.0 implementation) for the transactions. Should I use JTA which is container managed transaction or is it overkilled to use it? Currently I am using JTA and it turns out it is

The chosen transaction strategy requires access to the JTA TransactionManager or Unable to build EntityManagerFactory

房东的猫 提交于 2019-12-20 21:07:05
问题 I am using Spring 2.0.6 and Hibernate 3.2.x on apache tomcat5.5,now we planed to changed our hybernate mapping files into hybernate+jpa support mapping files. for that we created files like this daoConfig.xml <beans:bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <beans: property name="jndiName"> <beans: value>java:/comp/jdbc/Paymentsdb</beans:value> </beans: property> </beans: bean> <beans: bean id="sessionFactory" class="org.springframework.orm.hibernate3

Spring + Hibernate +JTA - HibernateTransactionManager or JTATransactionManager

徘徊边缘 提交于 2019-12-19 09:52:45
问题 I want to Integrate Spring and Hibernate and use JTA for managing the transactions. I would also like to delegate transaction handling to the App server, which in my case is JBoss. I have a query regarding the configuration of the " transactionManager " bean in Spring: 1) Can we use HibernateTransactionManager and set the the properties hibernate.transaction.factory_class and hibernate.transaction.manager_lookup_class in hibernate.properties file? If not, why? 2) Or, should we use

change jta transaction timeout from default to custom

最后都变了- 提交于 2019-12-19 09:04:02
问题 I am using Atomikos for JTA transaction. I have following setting for JTA: UserTransactionImp userTransactionImp = new UserTransactionImp(); userTransactionImp.setTransactionTimeout(900); but when my code perform JTA transaction, then if it takes more than 5 minutes (which is default value) then it throws exception: Caused by: com.atomikos.icatch.RollbackException: Prepare: NO vote at com.atomikos.icatch.imp.ActiveStateHandler.prepare(ActiveStateHandler.java:231) at com.atomikos.icatch.imp

How do I mock a TransactionManager in a JUnit test, (outside of the container)?

隐身守侯 提交于 2019-12-19 05:15:54
问题 I'm using Spring 3.1.0.RELEASE, JUnit 4.8.1, and ultimately deploying my application to a JBoss 4.2 server (I know, I know). As part of setting up my unit test, I have this in my Spring test application context ... <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="userTransactionName"> <value>UserTransaction</value> </property> </bean> Of course, right now this fails because there is nothing bound to the JNDI name,

Can I exclude an exported package from a Java module?

我怕爱的太早我们不能终老 提交于 2019-12-19 02:59:30
问题 Modules jta and java.sql export package javax.transaction.xa to module dom4j As you can see, both modules jta and java.sql export the same package, javax.transaction.xa . However, the package in jta has classes that I require that are not present in java.sql . I would simply not require the java.sql module, but I need java.sql.SQLException . Is it possible to prevent java.sql from exporting javax.transaction.xa ? 回答1: The JTA GitHub reads the following in confirmation to what @Alan already

Java事务处理总结

左心房为你撑大大i 提交于 2019-12-18 20:09:44
http://lavasoft.blog.51cto.com/62575/53815/ 一、什么是Java事务 通常的观念认为,事务仅与数据库相关。 事务必须服从ISO/IEC所制定的ACID原则。ACID是原子性(atomicity)、一致性(consistency)、隔离性(isolation)和持久性(durability)的缩写。事务的原子性表示事务执行过程中的任何失败都将导致事务所做的任何修改失效。一致性表示当事务执行失败时,所有被该事务影响的数据都应该恢复到事务执行前的状态。隔离性表示在事务执行过程中对数据的修改,在事务提交之前对其他事务不可见。持久性表示已提交的数据在事务执行失败时,数据的状态都应该正确。 通俗的理解,事务是一组原子操作单元,从数据库角度说,就是一组SQL指令,要么全部执行成功,若因为某个原因其中一条指令执行有错误,则撤销先前执行过的所有指令。更简答的说就是:要么全部执行成功,要么撤销不执行。 既然事务的概念从数据库而来,那Java事务是什么?之间有什么联系? 实际上,一个Java应用系统,如果要操作数据库,则通过JDBC来实现的。增加、修改、删除都是通过相应方法间接来实现的,事务的控制也相应转移到Java程序代码中。因此,数据库操作的事务习惯上就称为Java事务。 二、为什么需要事务 事务是为解决数据安全操作提出的