Container « Transaction « JPA Q&A





1. Understanding EJB3/JPA container-level transactions and isolation level    stackoverflow.com

Consider this simplified view of some code with which I'm working:

@Stateless(...)
@Remote(...)
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public class FirstEjbType {

   @EJB(...)
   private SecondEjbType secondEjb;
   @EJB(...)
   private ThirdEjbType thirdEjb;

  ...

2. How to use Container Managed Transaction (CMT) with JBoss AS 6, Hibernate 3.6, JPA, JTA and EJB3    stackoverflow.com

I'm attempting to setup a web app using CMT. I've got it running standalone within Eclipse ok, and now I'm trying to get it working within Jboss AS 6, using Struts ...

3. How to get Container Managed Transactions (CMT) working with EJB 3.1, Hibernate 3.6, JPA 2.0 , JBoss and MySQL    stackoverflow.com

I was trying to get CMT working with JPA EntityManagers and EJBs, but came up with the error below. (stack trance truncated):

Caused by: java.lang.RuntimeException: **Could not resolve @EJB reference: [EJB Reference: ...

4. hibernate with Container Managed Transactions (CMT)    coderanch.com

Hi, I'm new to hibernate and trying to learn this technology. I'm trying to see how I can use hibernate in my domain layer with existing session beans facades in my service layer. How would transaction management work in this case. I'm currently running on websphere 5.1. I still want to use CMTs and let the container handle transactions set on ...

6. Handling Hibernate Session for Container Managed transactions    coderanch.com

Hi Eveyryone, I started using Hibernate and can any one explain how to handle Container Managed transaction. Here is my sample design I have stateless session Bean and DAO (Hibernate) layer, session bean class has multiple DAO calls in a single session bean method. Reason behind Stateless session bean is to handle Container Managed Transaction. So Can any one help me ...

7. Exception handling in EJB with Container Managed Transaction using Hibernate    coderanch.com

Hi, I am using EJB with transaction-type specified as "Container" in ejb-jar.xml. I am also using Hibernate for DB operations. Code in my DAO lokks something like the following. EntityManger entityManager = getEntityManager(); // this line will get the appropriate entity manager from EntityManagerFactory. try { enttyManager.merge(obj); } catch (exception e) { e.printStacktrace(); // never comes here when the exception occurs ...

8. Data not committing in database . Using Hibernate / Message Driven Bean/ Container Managed Transacti    coderanch.com

Hi All, I am try to add a record in the database using Message Driven Bean. I am using Container Managed Transaction. The MDB's onMessage() picks the message from the queue processes it and further gives it to Business Logic implemented through another Stateless bean which is container manged.From this the data is saved in the database using Hibernate. The code ...





10. Help with using container managed JPA transactions with Jax-ws    java.net

in jsf pages that create the container managed transactions, so i understand how it is done. My goal is to have webservices and jsf pages in the same project share the same persistence unit and have the container manage the transactions. I'm not sure how to do this with jax-ws webservices. I've tried rigging it up by putting a managed bean ...

11. Container Managed Transaction and Hibernate Search    java.net

Another think that I don't understand is that I have the same restriction with JTATransactionFactory. But in hibernate documentation, it is written : [b]org.hibernate.transaction.JTATransactionFactory delegates to container-managed transaction if an existing transaction is underway in this context (e.g. EJB session bean method), otherwise a new transaction is started and bean-managed transaction are used. [/b] In my case, no transaction is underway, ...

12. How to use JPA + JTA without EJB container correctly?    forum.hibernate.org

Preliminary: Why use JTA instead to use JdbcTransactionFactory if working without EJB container? Answer: If you want to use JBosscache or Infinispan as 2LCache impl. then you must use JTA. If configuring hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory then following warning comes out when creating the Enititymangerfactory (version 3.4): Overriding hibernate.transaction.factory_class is dangerous, this might break the EJB3 specification implementation If removing hibernate.transaction.factory_class property from persistence.xml ...

13. hibernate - container managed transaction - glassfish    forum.hibernate.org

Hi, I am trying to use hibernate within a CMT environment. Unfortunately i can't get it to work.. I would like to use CMT without the use of EJB if possible. My goal is to encapsulate all my hibernate CRUDs within DAO objects without the need of calling the transaction api directly. The JNDI Name of the JDBC Resources of the ...

14. JBoss and Container Managed Transactions (CMT)    forum.hibernate.org

Hi, I am using JBoss 3.2.1 with Hibernate 2.0.1 on top of MySQL 3.49 with InnoDB tables. I would like use CMT, but I am unsure of the correct configuration. The Using Hibernate with JBoss document lists the following mbean config file: jboss.jca:service=RARDeployer jboss.jca:service=LocalTxCM,name=MySqlDS

15. Hibernate + JBoss container managed transactions    forum.hibernate.org

Hi, I'm using JBos + Hibernate. I want to know if it is possible to setup hibernate to automatically enroll the session in a container managed transaction. I have tried to set the attribute in my ejb.jar to Container and comment out the session.beginTransaction() and tx.commit() but in this case no object goes into the DB. Thanks. ======================== This is ...

16. Using Container Managed Transactions with EJBs on Websphere    forum.hibernate.org

emmanuel wrote: Except that you don't delegate conection retrieval to a WS Datasource, I don't see any pb. Emmanuel - Can you explain what you mean by this statement - do I need to delegate connection retrieval to a Datasource? If so, how do I do this? I also need to further understand the relation bewteen Container Managed transactions and Hibernate ...





19. Optimistic locking with EJBs & container-managed transac    forum.hibernate.org

Our application is using the basic "session bean facade - thread local session - Hibernate-driven domain layer" model. All is basicall well. One of the key layers of our system is a distributed job handling framework, where all state relating to concurrent jobs lives in the database, and where jobs are farmed out to multiple machines with JMS. We are trying ...

20. Container-mamaged transactions supported by Hibernate?    forum.hibernate.org

I am new to Hibernate. After read the doc, I like it and want to use it in our project. My question is: I want to use container-mamaged transaction, can Hibernate support it? or where to find the resources about it? I browse the forum. I find that the transaction is started/commited/rollback by the codes in the post. Thanks for your ...

21. Best practices w/container managed transactions    forum.hibernate.org

22. Container Managed Transaction gets blocked for ever    forum.hibernate.org

Hi all, We are migrating a J2EE application from JBoss to SAP Netweaver using Hibernate as persistence engine. The application starts OK, even doing some read-only accesses to the database (via Hibernate) but once up & running we are having a very-basic transactional problem: Abstract: a Container Managed Transaction gets blocked for ever when an update SQL sentence comes after an ...

23. Problem with Container Managed Transactions    forum.hibernate.org

24. Commit problem -Container Managed EJB with Hibernate    forum.hibernate.org

Hi, I am using Container Managed stateful session bean with Hibernate. I have taken the table creation step out of transaction using transaction Attributes.Table creation is done.Data is not inserted into the table.I think, save is happening and commit is not happening.As i am using CMT i should not use explicit Transaction commit in my code.I am using the Transaction API.ie., ...

25. hibernate container managed transaction    forum.hibernate.org

Problems with Session and transaction handling? @In private Student student; @TransactionAttribute(TransactionAttributeType.REQUIRED) public String persist() { System.out.println("persisting Student instance"); getCurrentSession().persist(student); throw new RuntimeException(); } Hibernate 3 here after calling the persist method a runtime exception is thrown. So as per the hibernate documentation the transaction is rolled back. But actually the rollback is not happening and the student object is getting persisted ...

26. Hibernate and Container Managed Transactions    forum.hibernate.org

I've read all the "How to ask for help" section, but couldn't find any specific solution to an issue I face. I'm using a - Session Bean -> DAO -> DB approach, wherein the DAO has the hibernate methods only, but the transactions should be managed in the Session Bean. I'm using Weblogic and letting the container manage the Hibernate transactions. ...