jta

NullPointerException from Spring's LocalSessionFactoryBuilder

牧云@^-^@ 提交于 2019-12-25 08:59:13
问题 I'll try to configure spring with hibernate using JTA and I have this spring xml file: model.xml <beans> <bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="transactionManagerName" value="java:/TransactionManager" /> <property name="userTransactionName" value="UserTransaction" /> <property name="allowCustomIsolationLevels" value="true" /> </bean> <tx:annotation-driven transaction-manager="txManager" /> <jee:jndi-lookup id="dataSource" jndi

Why Entitys uninitialized collection is initialized automatically only for Entities persisted before current transaction?

醉酒当歌 提交于 2019-12-25 08:53:50
问题 (Please feel free to edit the title after reading this question) I have quite simple @ManyToOne bidirectional mapping between entities Parent and Child . The list of children Collection<Child> children in Parent is never initialized so it should be null . When using EntityManager.find(...) for previously persisted Parent and then getting the list from that Parent gives ArrayList even there are no children yet with this Parent and it is fine. However if persisting or merging a new Parent in

Unable to create requested service [org.hibernate.service.jta.platform.spi.JtaPlatform]

倖福魔咒の 提交于 2019-12-25 06:48:07
问题 I am using spring3 , hibernate4 , and maven3 and my this code gives me this error: Unable to create requested service [org.hibernate.service.jta.platform.spi.JtaPlatform] <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"

because of No bean could be found in the registry of type: PlatformTransactionManager

筅森魡賤 提交于 2019-12-25 06:47:11
问题 I am trying to configure the spring transaction policy <bean id="transactionManager" class="org.springframework.transaction.jta.WebSphereUowTransactionManager"> </bean> <bean id="PROPAGATION_REQUIRED" class="org.apache.camel.spring.spi.SpringTransactionPolicy"> <property name="transactionManager" ref="transactionManager" /> <property name="propagationBehaviorName" value="PROPAGATION_REQUIRED" /> </bean> this is my exception Caused by: org.apache.camel.NoSuchBeanException: No bean could be

Making sure JPA commits my transaction before another service accesses the data

[亡魂溺海] 提交于 2019-12-25 03:34:22
问题 It feels so simple: I have a ViewScoped bean (JPA2 + EE6 + Seam3, if that matters) where the user of the web application can invoke a method like this: public void save() { doEntityManagerStuff(); // manipulates data in the database callRemoteWebservice(); // which is to read said data and propagate it to other systems } Unfortunately, save() starts a transaction at the opening curly bracket and doesn't commit it before the closing bracket , meaning that the new data is not available to the

EntityManagerFactory not being injected using @PersistenceUnit

送分小仙女□ 提交于 2019-12-24 16:25:02
问题 I'm a java beginner. I'm in trouble to configure a persistance unit using JTA transactions. I need to use a PostgreSQL database that is already defined, configured and populated. Using netbeans, i created the persistance.xml and glassfish-resources.xml as fallows: <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence

(Transaction not rolling back) Spring-data, JTA, JPA, Wildfly10

假装没事ソ 提交于 2019-12-24 08:23:57
问题 I got this problem for a while and can't figure out what I am doing wrong. Here is the context: Spring 4.3.4.RELEASE Spring-data-jpa 1.10.6.RELEASE Hibernate 5.2.5.Final I'm using wildfly 10, starting via maven plugin configured datasource for JNDI lookup correctly using spring-data with @Repository on interfaces created entityManagerFactory as a spring bean (LocalContainerEntityManagerFactoryBean) as for transaction manager, I tried to use both 'tx:jta-transaction-manager' and spring bean

Object is not saved in mysql schema by Hibernate 4 (Jpa 2.0 + Jta using Atomikos transaction manager)

梦想与她 提交于 2019-12-24 02:24:16
问题 I am reading the book Pro Spring 3 and in the chapter about Global Transactions there is some example code for persisting an object into two different mysql schemas. I am running the code but the object is not saved in any of the two schemas. Here is the code. tx-jta-app-context.xml : <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema

EclipseLink does not work on Netbeans, is this normal?

时光怂恿深爱的人放手 提交于 2019-12-24 02:15:06
问题 It'll be weeks that I'm stuck with EclipseLink. I can not persist an object in my database. I use netbeans 7.3. I encountered this problem when I started designing a web application. What follows is the approach I have adopted. It may be that I do without me realize a mistake. After that netbeans has finished generating the project files I configured the jndi. Then I converted automatically with netbeans, the database tables in entity object. here is the link then, from these classes, I

UnsupportedOperationException When Using JPA/Hibernate On Websphere

别等时光非礼了梦想. 提交于 2019-12-24 00:38:33
问题 The Problem I am getting the following exception when trying to update records in my database: java.lang.UnsupportedOperationException at org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform$TransactionManagerAdapter.setRollbackOnly(WebSphereExtendedJtaPlatform.java:139).... This exception only happens when updating. Create, Read and Delete work fine. What are typical reasons for this code being thrown? Weird Twist We are required to use MyEclipseBlue and that Maven or ant