long « Transaction « JPA Q&A





1. EJB and JPA and @OneToMany - Transaction too long?    stackoverflow.com

I'm using EJB and JPA, and when I try to access PhoneNumber objects in phoneNumbers attribute of Contact contact, it sometimes take several minutes for it to actually return data. It ...

2. Multiple Threads accessing the database: one with long transaction, one with short transactions    stackoverflow.com

Let's say I have a desktop app that acts as a garage for a bunch of cars:

@Entity
public class Garage {
    private List<Car> cars = new ArrayList<Car>();
   ...

3. Hibernate: A long read-only transaction will now require a small DB update in the middle    stackoverflow.com

I have written quite a complicated engine of sorts which navigates up and down a large series of objects read in from the database. So I have code that looks something like ...

4. Dealing with deadlocks in long-running Hibernate transactions    stackoverflow.com

I have a Hibernate application that may produce concurrent inserts and updates (via Session.saveOrUpdate) to records with the same primary key, which is assigned. These transactions are somewhat long-running, perhaps 15 ...

5. What if my transactions are too long?    forum.hibernate.org

Ok... My application is having a problem... Sometimes, it seems that I run out of available transactions, but when I check the database transactions all of them are idle... When this happens, the only way to solve it seems to be to stop the application and restart it. I believe the problem may be that some of my transactions are really ...

6. How long the hibernate object is available after commit    forum.hibernate.org

Once I commit the transaction, can I keep referencing the hibernate object only in read-only mode. For example : RepositoryIntf repo = new Repository(User.class); Transaction tx = HibernateUtil.getTransaction(); User u = new User(); u.setLoginId("abc"); repo.save(u); tx.commit(); ................. Can I continue accessing this object "u" after commit or it has a life time after which object gets destroyed automatically. ................ What would ...

7. Long transactions and locks with TableGenerator    forum.hibernate.org

Hi, We use @TableGenerator JPA annotation in entities to generate ids a DBMS independent way. It works well most of time, but we have problems with SQL Server 2008 because of long transactions that put locks on the id generation table. From what I understood TableGenerator uses the Hibernate session connection and so the current transaction. Is there a way to ...

8. Is SessionInView bad in JTA scenario? Long transaction times    forum.hibernate.org

Hi, Trying to get to grips with a "open session in view" approach, and the mixture of that with transactions. It appears I have to tell Hibernate which transaction strategy I want. For example, if I use Hibernate's local transaction strategy then I have to, in my action, get the transaction from Hibernate's session, do the work, then commit the transaction. ...

9. Problem saving object in long transaction    forum.hibernate.org

Newbie Joined: Fri Dec 05, 2003 12:44 am Posts: 16 Hello, I'm currently in the process of migrating from CastorJDO to Hibernate (I have to say this is soooo overdue!) and have run into an exception I don't really understand. Code: net.sf.hibernate.HibernateException: reassociated object has dirty collection reference at net.sf.hibernate.impl.OnLockVisitor.processCollection(OnLockVisitor.java:68) ...





10. Correct way to update object in long transaction?    forum.hibernate.org

Quote: it does. not for me... I must have something wrong with my mapping. Also could you please let me know what the exception that should be throws is and fom where you'd expect it would be thrown. Code: ...

11. long lasting transactions    forum.hibernate.org

Hi I'm using Hibernate version 2.1.2, MySQL version 4.0.18 I have a question regarding long transactions using session.disconnect() and session.reconnect(). Is it dangerous to simply make a method that returns the session in a disconnected state, and whenever I make a connection to the DB I reconnect, do what I want, and then diconnect like this: //+ imports; public class UserService ...

12. How to create "long transaction lock"?    forum.hibernate.org

Newbie Joined: Wed Feb 11, 2004 5:08 am Posts: 14 Hi all, I'm writing a desktop application which uses MySQL database as a data storage. In the application I have documents which are loaded from the database, edited in the client and then saved back to the database. Now I'd like to implement a same kind of like functionality that for ...

13. Best Practices: Howto cache instead of long transaction    forum.hibernate.org

Hi I'd like to use Hibernate for the following UseCase: A user does some manipulations on business objects, and when he saves the work, the BOs are made persistent to the DB. Strategy 1: At the beginning I start a transaction, and when the user saves, I commit the whole stuff and start a new transaction. The disadvantage of this is ...

14. Long running nested transactions    forum.hibernate.org

What would be the best approach for implementing long running nested transaction support with hibernate? Long running transactions prevent the use of JDBC based nested transactions using rollback as connections are being re-used between different hibernate sessions due to pooling. E.g. 1 create hibernate session 2 start txn A 2 objX.setName("Bob") 3 start txn B child of A 4 disconnect session ...

15. Long sessions and concurrency    forum.hibernate.org

Hibernate version: 2.1 Hi all, Short version: If an object exists in two sessions, and is updated in one, is there any way to propagate that change to the other session? Longer version: My application uses Hibernate in a service layer that's invoked from .NET clients via SOAP requests. I am using Castor to marshal/unmarshal objects on the server side, with ...

16. There are no long transaction practice found here    forum.hibernate.org

Hibernate version:2.1.8 I want to talk about the session used with Tomcat. There are many articles that are examples about using ThreadLocal in Servlet or Filter. And all the articles recommands us CLOSE session before leaving the current thread. I followed the recommandation and examples, but do they just work in simple situation? If an entity has one-to-many items. In first ...





17. Pessimistic locking with long session    forum.hibernate.org

I am trying to design out our application and our database architecture but I am having some problems finding the correct solution to our problem. In the Hibernate in Action book on page 172, first paragraph, it says that you may "implement a simple long pessimistic lock yourself, using Hibernate to manage the lock table. Patters for this can be found ...

18. Long Sessions (application transactions with long sessions)    forum.hibernate.org

I need some advice on how to keep objects in the session when working with long sessions (as described in Hibernate in Action p. 325 8.2) I would like to keep some object always bound to the current session, like for example, the user context object, after logging in to the system. This is very convenient, as the user object is ...

19. Hibernate in Long running JTA transaction    forum.hibernate.org

Hello, I have been searching the forums but could not get an answer for a problem that I must solve. I have an remote application makes calls to jboss contained EJB3 Stateful session bean - Hibernate 3 - JTA - Mysql. When I need a transaction in a single call that is fine. But at some point in my app, my ...

20. Threadsafe issue on Extended session (long transactions)    forum.hibernate.org

Hibernate 3. Transactions managed by JBoss. One approch to support long transactions in Hibernate 3 is the Extended session. A single Session instance are used for the whole conversation. The Session is disconnected from any underlying JDBC connection when waiting for user interaction. Beginning a new database transaction on an old session obtains a new connection and resumes the session. Usually ...

21. Long Transaction Support (Oracle Workspace Manager)    forum.hibernate.org

Hi, I am considering to use [b]Oracle Workspace Manager[/b] because of their support for [b]Long Transactions[/b]. I was wondering how hibernate will handle this. We are currently using hibernate as our Relational Persistence mechanism. Has anyone had this requirement before or could someone give some advice on the topoic? Thanks in advance Clint

22. long transactions    forum.hibernate.org

I'm looking at Hibernate for use in a rich-client GUI with long running transactions. I've researched this subject and it points to the session-per-conversation pattern. I have two areas of concern with using this pattern and I want to verify that my concerns are valid and I want some advice on working around them. Exceptions: If you receive an exception, you're ...

23. Ajax application with long running session / transaction    forum.hibernate.org

Hi Folks, I am writing a web application in which users complete a series of forms, each of which contains several fields. We are using Hibernate to persist the state of our model, and since the application is ajax-enabled, the value contained within a field is submitted via an xml http request immediately after the user has de-focussed that field. Additionally, ...

24. No Exception on rollback for long running transaction    forum.hibernate.org

Dear All, I am using JBoss 3.2.7 to deploy my application which consists of stateless session beans with CMT. I am using Hibernate 3.1.3 for persistance and MySQL 5.0.41 with InnoDB as my DB server. I am facing a strange problem. I have one bean method where the transaction takes more than 8 minutes to complete. The web page calls the ...