ejb « Transaction « JPA Q&A





1. How can I implement a proper counter bean with EJB 3.0?    stackoverflow.com

[EDIT] This question is "how do I do atomic changes to entity beans with EJB 3 and JPA 2.0". Should be simple, right? I tried to fix my code based on the ...

2. Is JPA + EJB to much slow (or heavy) for over Internet transactions?    stackoverflow.com

I am developing a stand-alone java client application that connects to a Glassfish v3 application for JPA/EJB facade style transactions. In other words, my client application do not connect directly to ...

3. how to raise OptimisticLockException    stackoverflow.com

Unable to catch optimistic lock exception. one way to raise OptimisticLockException is by using em.flush()

try{
   //some enitity
   em.flush()
  }
catch(OptimisticLockException ole){}
but i dont think this is best ...

4. Debugging transactions in Java EE    stackoverflow.com

I have an @Stateless EJB method in which I

  1. delete some entries from a database using JPA remove()'s
  2. throw an Exception that is annotated as @ApplicationException(rollback=true)
I have no other transaction-specific annotations for ...

5. Jetty 8 + EJB 3.1 + JTA + CDI + JPA 2 stack?    stackoverflow.com

Can anyone tell me if it is currently possible to "glue together" a partial Java EE 6 Web Profile over Jetty? I've found a lot of articles about integrating standalone EJB ...

6. EJB Transaction problems    stackoverflow.com

I have an EJB which purpose is to copy users from another system to mine, by either creating the user if missing, or updating the existing user that has the same ...

7. Transaction didnt rollback but committed using Hibernate JPA 2.0 and EJB3 with BMT    stackoverflow.com

I have been studying about JPA 2 with hibernate on ejb3. So I made a sample class to test the functionalities. I have tried using BMT transactions but facing problem on ...

8. Two phase commit transaction in Java EE 5    stackoverflow.com

I want to know that how can I do two phase commit transaction by using Java EE5...I am using EJB with JPA which has hibernate configured with MySql. I just want ...

9. How to return result of transaction in JPA    stackoverflow.com

Just a background since I am used to using JDBC since I worked on an old project. When saving into database, I always set the value to -1 for any unsuccessful insert

public ...





10. Transaction spans multiple EJB Instances    stackoverflow.com

I have spent last two days to figure out a Hibernate Transaction Problem... I am using Websphere 5.1 (J2EE 1.4) and have two EJBs deployed which are using Hibernate as ORM. Here is ...

11. Transaction Scope - EJB and Hibernate    coderanch.com

12. How to open a new hibernate transaction with ejb3?    coderanch.com

Hi everybody! I have a simple but annoying question . How can I make (or call for) a new transaction when running along all the hibernate process? What I mean is the following. I have a web service running with Jboss and Hibernate (using ejb3). The thing is that I want to make 5 inserts, but for example if the no. ...

13. How to open a new hibernate transaction with ejb3?    forum.hibernate.org

Hi everybody! I have a simple but annoying question. How can I make (or call for) a new transaction when running along all the hibernate process? What I mean is the following. I have a web service running with Jboss and Hibernate (using ejb3). The thing is that I want to make 5 inserts, but for example if the no. 3 ...

14. Transaction Handling with EJBs and Hibernate    forum.hibernate.org

I am going ahead using Hibernate :-) and integrate it with my EJBs . I have a question : Hibernate provides its own SessionFactory , Transactions .. But I dont want to use them. If I am using a Session Bean(CMT) then all my transaction handling is already done by the container. I dont want to mess my code with all ...

15. Exception in Transaction Rollback with EJB    forum.hibernate.org

Newbie Joined: Thu Aug 12, 2004 10:02 am Posts: 8 Hibernate version: Mapping documents: Code between sessionFactory.openSession() and session.close(): Full stack trace of any exception that occurs: Name and version of the database you are using: Debug level Hibernate log excerpt: When ever a runtime exception occurs after session.save(POJO), hibernate tries to insert the data into the database eventhough it is ...

16. Using ejb transaction instead of hibernate transaction    forum.hibernate.org

Hi. Did you do session.saveOrUpdate()? did you do session.flush()? I think that in the first code, you didn't do session.flush(), and therefore, no sql code was executed to the db. in the second code, the session.flush() wad executed by the transactin.commit(). try the session.flush() (without the transaction) and see if it works for you. Jus.





17. ejb transaction and hibernate    forum.hibernate.org

Newbie Joined: Fri Dec 24, 2004 8:32 am Posts: 3 Location: Paris Hello everyone. First of all, happy new year ! Well, the fact is I'm having a little problem using hibernate in a Stateless Session Bean. I just wanted to let EJB managed the transaction. So I writed EJB in wich I call my Hibernate Code. My problems occurs when ...

18. EJB Transaction and Hibernate    forum.hibernate.org

Hi, I am using Hibernate v2.1.7. Can someone please point me to the documentation where it states NOT to explicitly call begin transaction and commit transaction in an EJB transaction (say using Weblogic)? I've repeatedly searched the "Hibernate in Action" book and online docs, but can't seem to find ample documentation on this. Thanks for your help.

20. how create a new session in ejb that using jta?    forum.hibernate.org

What do you mean you cannot open new session? Who provides a transaction for your request? Otherwise SF.getCurrentSession() doesn't work, if there is no underlaying transaction. There is no problem for you to open a new session - SF.openSession(). It will still be a part of previous transaction. You can even open a new transaction, suspending the current and later on ...

21. How to manage hibernate transactions using EJB    forum.hibernate.org

We have two methods in Session Bean: A() and B(). A() and B() are called from another function in struts action class. A() and B() saves and updates data using hibernate. We want A() and B() operation to be atomic. That is if A() passes but B() fails, updates done by A() should be rolled back and vice versa. We want ...

22. ejb 3.0 optimistic locking problem    forum.hibernate.org

Beginner Joined: Tue Jan 17, 2006 6:16 am Posts: 31 i tryed to use locking into ejb 3.0 here is my program fragment Code: @Stateful @Remote(CountFasade.class) public class CountFasadeBean implements CountFasade { @PersistenceContext(unitName = "Test", type = PersistenceContextType.EXTENDED) private EntityManager oracleManager; @TransactionAttribute(TransactionAttributeType.REQUIRED) public void update(long start, long end) throws ...

23. EJB 3 and Hibernate Transactions (SUPPORTS)    forum.hibernate.org

You can't have no transaction and bind the current Session to the current (non-existing) transaction. Why do you want to use SUPPORTS? It's very rare that you can say "if a method on his bean is called, it's fine if a transaction context is present, but it doesn't matter if it's not there". Especially in a bean that does data access ...