concurrent « Transaction « JPA Q&A





1. JPA cache up-to-dateness with concurrent access to the database    stackoverflow.com

A service tier that implements its persistence based on JPA can profit hugely from the second-level cache that is managed transparently by the JPA provider (e.g. Hibernate, Toplink/Toplink Essentials etc.). When ...

2. Use two databases concurrently in Hibernate    stackoverflow.com

I've to use more than one database together (on the same connection... ) via mysql. I want to use hibernate, but all I can find around is to use two sessionfactories. ...

3. Hibernate + concurrent inserts (MySQL INSERT IGNORE)    stackoverflow.com

I'm learning to use Hibernate. I'm wondering how to do concurrent inserts in hibernate properly. I have an url table defined as:

CREATE TABLE `urls` (
    id INT PRIMARY ...

4. Hibernate concurrent insert    stackoverflow.com

I faced a problem. I have an App with Hibernate that loads data from XML files into tables in concurrent mode. Some part of data could be same and could be ...

5. How does JPA2.0 handle concurrent requests by client?    stackoverflow.com

How does JPA handle single request and 1000 requests for the same data from database? Is there any change in accessing the speed of data if 1000 request same data at ...

6. Hibernate causing Concurrent Modification Exception    coderanch.com

Hibernate 2.18 and JBOSS 4.0.0 and MYSQL 4.1 Please could someone assist with this bizarre problem: whenever i attempt an UPDATE of a loaded object i get a ConcurrentModificationException. All I am doing is 1) get new session from sessionfactory 2) load object 3) change object 4) commit changes I have Hibernate working within a stateless session bean environment with business ...

7. Should JPA handle concurrent updates?    coderanch.com

Hi all, just a question i'm puzzling on at the moment. Should JPA implementations throw something like 'ConcurrentModificationException' when two instances of an application modify the same row? Or in other words: should JPA solve the lost update problem? Or in even other words: User A retrieves Record A User B retrieves Record A User A updates Record A and stores ...

8. JPA: Special considerations for concurrent transactions?    coderanch.com

Hello, Recently, I've been using JPA with thread local entity managers that create transactions and merge/access entities concurrently on a single database. This has exhibited many issues (deadlock, timeouts, entities simply not being persisted, etc etc), and before going into any of them, I would like to get a general idea of what configuration is necessary for using JPA under such ...

9. Handling the concurrent requests more than table can handle?    forum.hibernate.org

I have a scenario where in the table called USER_RESPONSE_SUMMARY there are 20 records and 2500 concurrent users/threads are hitting the db and trying to update those 20 records.No new inserts. Due to this we were having locking problems with the table. This table just tracks the user response summary in aggregation where as actual USER_RESPONSE table stores responses. I am ...





10. Concurrent Sessions not seeing each other    forum.hibernate.org

Hi, i have two threads (each thread with its own session) which execute the some code. The code reads data from the database and marks the datasets as "in work". It is vital for me that the changes one thread does are visible to the other thread so that the some datasets are not processed by both threads. This exactly is ...

11. Concurrent-update-check using a hash    forum.hibernate.org

Can hibernate perform a concurrent-update-check (stale object check) without version field, but instead using a hash? For example: Step 1: Load an object from db Step 2: disconnected (perform a hash of the object's original data) Step 3: user makes some changes to the object Step 4: reconnect Step 5: session.update (re-read object from database and compare with hash) If the ...

12. Concurrent database access    forum.hibernate.org

What is the best solution for the following problem: Two different processes (e.g. applications) are accessing the same record via hibernate. Both processes are reading, modifing, and writing back the modified value. Via the transaction isolation level I can ensure that the changes are only visible after the commit. But how can I ensure that both processes are not reading stale ...

13. Concurrent Transactions causing a deadlock    forum.hibernate.org

Expert Joined: Thu Jan 29, 2004 2:31 am Posts: 362 Location: Switzerland, Bern Hi All We're currently in the process of investigating Hibernate in order to get rid of Entity Beans. One major concern is, whether Hibernate does proper transaction handling. Therefore I did the following test: My business classes consist of a parent class Wertpapier and a child class Kurs. ...

14. concurrent transactions    forum.hibernate.org

I am in the process of implementing a number of worker threads. My simple concern is how many sessions I should use. Should I use a session per worker thread or can I use a common session. Using a common session, multiple transactions would be created concurrently within the same session. Is that supported/advisable ? Henrik

15. Concurrent access of table    forum.hibernate.org

I am new to hibernate and currently exploring to use for the project. I have seen lot of advantages of hibernate. But i have one question : Is their any way by which hibernet implements concurrent issue. I mean suppose two user will try to update same row symultaniously then what will happen? Does hibernate have built in feature to handle ...

16. Question about concurrent modifications    forum.hibernate.org

Hello everyone, Hibernate version: Hibernate 2.1.3 Name and version of the database you are using: MySQL 4.0 In my web-application, I today observed the event of two concurrent requests modifying the same persistant object (but different properties/columns) at neary the same time. The result was that the "second" request has undone the changes of the "first". This is no wonder, since ...





17. multiple concurrent transactions from same session    forum.hibernate.org

Command must be a good way for this use case : abstract class Command { protected abstract Serializable doExecute(Serializable[] args); final public Serializable execute(Serializable[] args){ Session s = getSession(); try{ Serializable result = doExecute(args); //commit return result; }finally{ s.close(); } } } Remote object implementation is trivial: Serializable execute( Serializable cmdId, Serializable[] args) throws RemoteExeption{ return COMMAND_MAP.getCommand(cmdId).execute(args) } Client can send ...

18. Concurrent Edits    forum.hibernate.org

Beginner Joined: Tue Nov 02, 2004 1:34 pm Posts: 45 What happens when two people edit a record at the same time? Unless something is done, the last person to save wins....the first edits are lost. I'm seeking input on the following code I wrote to have some protection from this. All of my records have a "last_mod_date" field. When someone ...

19. Hibernate Concurrent problem....???    forum.hibernate.org

Read the rules before posting! http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 2.1.8 Mapping documents: ...

20. concurrent access to persistent objects?    forum.hibernate.org

21. Concurrent    forum.hibernate.org

Hi all, I am dealing with an interesting situation when using hibernate + mysql and I don't know exactly if it is a bug (in Hibernate or MYSQL or both). I DO NOT HAVE THE SAME PROBLEM WITH POSTGRESQL: I did a simple class (see below) to test Hibernate's behavior under a stress situation. During the execution of my class, after ...

22. concurrent sessions    forum.hibernate.org

Hello everybody, I m new on this forum and also i m new to hibernate. My probelm is............. I have an Object having some attributes like Id,userID, password, status. Primary key is Id. I m using MySql database. I m using save() to insert this object's details in the database. On a particular page , user enters the userId (String) ,password ...

23. concurrent problem    forum.hibernate.org

hi, I got a concurrent problem about hibernate3.0 I use as concurrent control following is my program: public void save(Object entry) { Session session=getSession(); Transaction transaction=session.beginTransaction(); try { System.out.println(entry.getLastDate()); session.update(entry); transaction.commit(); } catch(Exception e) { transaction.rollback(); } session.close(); } in normal case, it can work fine, when there is an exception(for example unique checking) occured when "session.update(entry);" the ...

24. Concurrent Tx and Hibernate cache    forum.hibernate.org

Hi, I'm load testing an application in JTA environment, DBServer is seperate from App Server, using ehcache. Every request results in one or more DB hits. Sometimes i get this exception, which I'm unable to understand. Some important property settings are: true true false org.hibernate.cache.EhCacheProvider true auto 10 true true Hibernate version:3.0.5 ...

25. Multiple Concurrent Sessions    forum.hibernate.org

Hi, I am looking for a way to work on the same object within two sessions. One session is the reader session for lazy=true objects. In that session write attempts are never made (if I get it right from the reference manual, a session is unusable after an exception has occurred, so I do not want write attempts to corrupt my ...

26. Problems with Hibernate dealing with concurrent transactions    forum.hibernate.org

Newbie Joined: Mon Aug 14, 2006 10:42 am Posts: 1 We are using mySQL v5, Hibernate 3.1.2 and Spring 1.2.6 in our application and are confronted with the following: this is our hibernate.cfg.xml file: ========================= false org.gjt.mm.mysql.Driver jdbc:mysql://127.0.0.1:3306/BWB 8

27. Concurrent blocking question    forum.hibernate.org

Hi, I was just wondering about the nature of Hibernate. If I wrote the following code: Code: class SimpleDAO { private Session session; private Transaction tx; public void create(Event event) throws DataAccessLayerException { try { ...

28. Problem with concurrent cache updates    forum.hibernate.org

Good day! There is multiple update of stale cache entries. I've used EhCache and OSCache, but result is still the same. I've written high concurrency site with heavy database queries (using Criteria queries). I've set up cache for 5 minutes expiring interval. So, each 5 minutes many users trying to load main page of my site, and there is many identical ...

29. Concurrent Updates - Question    forum.hibernate.org

Thanks. Now I looked at the version element. Does it mean that I should add a version column in my tables (and in mapping file) wherever I need to avoid the dirty update? My mapping is ...

30. Concurrent problem?    forum.hibernate.org

I have the following situation: I'm using Spring 2.0.6, hibernate 3.2 and Oracle 10g There is a table that concentrates a lot of traffic in the application (it is an auditting table) and from time to time it produces a "JDBC can't execute batch update" exception. I believe this is because there is a lot of concurrent access to this table ...

31. concurrent StatelessSession and Session usage in a webapp?    forum.hibernate.org

We are currently using the session per request pattern for our webapp. However, in one of our use cases, we have a user upload a large file to be processed in real-time. We would like to use the StatelessSession instead of the Session for this use case. My questions are: 1) Are there any ramifications to concurrently using Session and Stateless ...

33. Concurrent exception ...    forum.hibernate.org

I'm using Hibernate with HSQL database in a Swing application. For representing data JTable is used with custom table model. The main entity in database is a Movie, and for getting a Movie there is a method: Code: public static Movie getMovie(Integer movieId) { EntityManager em = DatabaseManager.getEntityManager(); return ...