concurrency « Transaction « JPA Q&A





1. ConcurrentModificationException and a HashMap    stackoverflow.com

I am persisting objects using JPA. The Main object has an owning One-Many relationship with another object. The other object is stored in a HashMap. What sort of ...

2. java.util.ConcurrentModificationException on CollectionOfElements    stackoverflow.com

I seem to get a ConcurrentModificationException when I have a CollectionOfElements inside an Embedabble. If would like to have it like that, however If I change Route from Embedabble's to Entity than ...

3. concurrency in hibernate    stackoverflow.com

I have a servlet that does some work for user and then decrement user's credit. When I watch user's credit in the database in real time, if there are many concurrent ...

4. Concurrency issue in JPA and JTA    stackoverflow.com

Possible Duplicate:
concurrency (stale data) problem in JPA
Sorry for duplicating, but I think I didn't get satisfactory answers so posting again Let's say I have methods ...

5. Concurrency problem leaving database in inconsistent state.    forum.hibernate.org

I'm having a problem that's not Hibernate specific, though I'm using Hibernate and dont know if it has something builtin that can help. If this doesn't belong here then I apologize. In general the problem is the following. I have the following tables TABLE A ----------- AMMOUNT : NUMBER TABLE B ------------ PAYMENT_AMMOUNT : NUMBER I would be adding payments to ...

6. Transaction Concurrency issue    forum.hibernate.org

Hi everyone, Happy New Year to all. I am facing concurrency issues in my Web App and I used hibernate version to fix it. It fixed the problem but then application is considerably slowing down to the extent of beoming non-responsive. We have restart the server to fix it. We have checked the memory consumption, db connection pooling and db locks, ...

7. concurrency execute servlets problem    forum.hibernate.org

Newbie Joined: Thu Mar 11, 2010 6:32 pm Posts: 1 Hi all, We have a lot of problems with concurrent execution of a single service running that query data using sessions (org.hibernate.SessionFactory) builded dynamically with hibernate, the problem is when th program execute the concurrency way the last request works and the first requests throw a runtime error with the access ...

8. Concurrency Issues sumitting request using Hibernate and JPA    forum.hibernate.org

Newbie Joined: Wed Apr 14, 2010 4:14 pm Posts: 5 Problem Summary: When running a multiple user stress test of a Web app which had multiple users submitting a transaction (the same type thus exercising the same code base) at the same time (i.e., click on a Submit button), 6 out of 8 failed. Env Details: WebSphere Platform 6.1 [ND 6.1.0.23 ...

9. Concurrency issue with findOrCreate    forum.hibernate.org

Hello all, I've been working with a testing environment where the entire schema is created upon startup, and then we benchmark how long it takes to persist a few instances of our data model in parallel. The issue is that there's some more generalized "static" data that is used in all of the data model instances. When persisting in parallel, we ...





10. Concurrency execution time problem    forum.hibernate.org

Hi! I have got a problem with method execution time in my concurrency application. My hibernate configuration is: Code: org.hibernate.connection.C3P0ConnectionProvider org.hibernate.transaction.JDBCTransactionFactory org.hibernate.dialect.MySQLInnoDBDialect org.hibernate.context.ThreadLocalSessionContext @hibernate.connection.url@ com.mysql.jdbc.Driver @hibernate.connection.user@ @hibernate.connection.password@ 5 100 1800 50 59 3 select 1 My dao methos is: Code: @SuppressWarnings(value = "unchecked") ...

11. in need of a discussion about concurrency implementation    forum.hibernate.org

From what i understand about concurrency in hibernate is this: You use read committed mode in conjunction with versioning. So assume you start a session and make your query. The returned objects, representing your query result, will be only accessible within you persistence context(session). When you want to update and commit your changes, hibernate will obtain a read and write lock ...

12. Concurrency issues    forum.hibernate.org

Hi All, I have been struggling with a concurency issue for the last couple of days and I have to admit that it is starting to drive me crazy. I am using Spring 3 along with Hibernate. I have the following controller (in the MVC layer) : Code: @RequestMapping("/smppMTDS") public ModelAndView handleRequest(HttpServletRequest request, ...

13. Concurrency origin (database or hibernate)    forum.hibernate.org

Using 3.6.4 of Hibernate.... Monitoring my application with Introscope. Seeing performance slowdown when the concurrent on my DAO (singleton through Spring) goes from a low of 1 up to 9. The number of active connections in the Weblogic DataPool (around DB2 driver type 4) increases in line with the concurrence. The response times for a particular query go from 30ms to ...

14. Concurrency handling with locking mechanism?    forum.hibernate.org

Hi! I am developing an application (deployed on JBoss 5.1.0.GA) containing a method where a single entity is picked from a collection selected from the database. Concurrent access for this method should be possible and handled like "take the first entity and mark it as reserved, if it is still reserved by another process just pick the next entity and so ...

15. Concurrency problems with optimistic locking    forum.hibernate.org

I problem with concurrency (optimistic locking). When userA deletes the record and userB updates it, I get an error. My problem is when userA updates the record and userB updates the record later, userB overrides the change made by userA. But I should get a StaleObjectError when userB updates the record. I am using the technique mentioned in the reference document ...

16. How to handle DB-based optimistic concurrency control?    forum.hibernate.org

Hello folks, has anyone used hibernate with a database that uses optimistic concurrency control (OCC) to guarantee transaction isolation (especially with JTA)? ciao Sven For those of you who might not remember db based occ a short refresher: A database has to take care that transaction A can not read dirty data from transaction B. The majority of current commercial databases ...





17. Hibernate, Transactionality, & Concurrency    forum.hibernate.org

Newbie Joined: Thu Mar 18, 2004 2:35 pm Posts: 1 Hibernate of course implements threadsafe SessionFactory objects that can be used to create non-threadsafe Session objects. You can blindly try to keep Session objects open as long as possible (to improve performance reaching the database through keeping active and pooled connections open) in a multithreaded Java application by implementing ThreadLocal variables, ...

18. Could someone please clarify my confusions about concurrency    forum.hibernate.org

Hello, I'm relatively new to middleware architectures and programming, and I still am trying to understand some basic points about enterprise middleware architectures... First of all some remarks, in order to know if I understood things right.. 1. Hibernate uses a per request cache(in case you do not disconnect and reuse the Session between requests. So a request level cache is ...

19. how do we do concurrency management in hibernate    forum.hibernate.org

20. Strategies for Application transactions and concurrency    forum.hibernate.org

In the ideal world, we would all be able to change an existing database schema to add the simple version column and make this a moot point. However, my scnerio is such that we have a legacy application that will be accessing the same DB instance as our new J2EE application. Since most web apps have long running application transactions, and ...

21. Optimistic Concurrency control in web applications.    forum.hibernate.org

I would just like to go over the functioning of version control. We use Hibernate 2.1.3 to MySQl 4.0.18 in a three tier (Struts/ Spring /Hibernate) system. The object data is stored in ActionForms between http sessions. So to save the changes in the ActionForm back to the database, when the object has been modified by a previous session, we go ...

22. Does Hibernate support concurrency control?    forum.hibernate.org

I am new to Hibernate. Sorry if my questin is naive. The problem is that I need to write application and two users of this application will possiblly view and write the same record at the same time. I simply would like to know whether Hibernate can handle concurrency access and in what ways. Thanks a lot!

23. Concurrency control    forum.hibernate.org

Hello.... I have a system using JBoss + Hibernate that access a database (for example Oracle) and another one in .Net that access the same database, what happens if this second one try to access a data that it's being using by the first one. The Hibernate lock tells to the database to lock the objects that i'm using? Thanks very ...

24. concurrency and hibernate    forum.hibernate.org

We are trying to explore possibilities of following: 1. user1 loads an object from db, changes some properties on it and after validations tries to save it. Meanwhile user2 logs in and deletes that item even before user1 sent an update(). How would hibernate trap the deletion and let user1 know that no object exists ? 2. user1 loads object from ...

25. Concurrency access doubt    forum.hibernate.org

Hello all! Im a new Hibernate user , doing some application tests so.. Suppose i have two objects loaded in diferent sessions and they point to the same row in database . Session 1 Object A is deleted then in Session 2 i try to insert it (Object A) on another object. How could i threat this situation !? Show an ...

26. What about concurrency?    forum.hibernate.org

View unanswered posts | View active topics Board index Hibernate & Java Persistence Hibernate Users All times are UTC - 5 hours [ DST ] What about concurrency? Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message caetano Post subject: What about concurrency? Posted: ...

27. Handling concurrency issues with web apps    forum.hibernate.org

Ok...here's a general development issue that conerns any web based app that is data entry oriented. I've been doing reporting systems so long, I've gotten a bit rusty with transactional development. What's the best strategy for avoiding "last save wins" concurrency issues? If two people open a web maintenance page, change data, and save, the "last saved" wins, meaning the person ...

28. DB genereted PKs + concurrency + Hibernate + best practices    forum.hibernate.org

Hi all, I'm supposed to integrate a legacy database powered by Firebird with a new system and of course I'm planning to use Hibernate. The the database generates primary keys using a combination of generator + trigger which is fired before insert to overwrite user supplied PK values with the next value from the appropriate generator. I mapped the id as: ...

29. concurrency management with a rich client    forum.hibernate.org

Hi, I am developing an application using Java POJO and Hibernate at the backend, and a rich client at the front end. Communication between backend and frontend will be XML-based through a servlet, and based on primitive values (integer ids, strings etc). It is not possible to store java objects natively on the client. I am not interested in pessimistic locking, ...

30. concurrency problem in multithread application    forum.hibernate.org

31. Concurrency in hibernate    forum.hibernate.org

32. problems of concurrency of hibernate    forum.hibernate.org

Pool size of 1 means you only allow one client to access the resource at any one time. The result is all requests to the database will be serialised. Yes clients can be very slow and I would suggest yuou have atleast 2 for development (I tend to have 4). Production pool size depends on your application. The pooling scales well ...

33. Transaction Concurrency    forum.hibernate.org

Hibernate Version: 2.1.4 I hope I no one will be offended if I ask a general question. We have encountered a highly repeatable situation and I could use a little education as to how to best avoid it. Imagine, if you will, two threads with identical activities and overlapping transactions: 1) Session a/Transaction a begin and load an Object X. 2) ...

34. Problem implementing optimistic concurrency control    forum.hibernate.org

Hi, I am trying to implement automatic optimistic concurrency control in my application using version field. I have given the following mapping in my xml file: I am getting the following exception while trying to map the version field in the xml mapping file: org.hibernate.MappingException: Could not read mappings from resource: india/data/project3/portal/bo/BOAddressInfo.xml Caused by: org.xml.sax.SAXParseException: Element "class" does ...

35. Concurrency problems    forum.hibernate.org

I have a question about concurrency and databases. And maybe hibernate has a solution for this. I've built a concurrent system which reads a record from one db transforms it and saves it to another db. This is done with the command pattern, where each entity is contained within a command. The command copies all properties from the source entity and ...

36. Hibernate concurrency issue    forum.hibernate.org

We have a cluster contanining 2 servers. There are multiple queues on each server and each queue gets the tasks that it wants to process from the DB which is unique since the tasks in the database table have the queueId as one of the columns. This configuration works fine in a single node but in a cluster the database table ...

37. concurrency issues ...    forum.hibernate.org

i use Hibernate 3 with CMT[container managed transaction] on jboss 4. - if session flushmode is set to FlushMode.COMMIT, then it appears more efficient and there are much less concurrency related exceptions than the default FlushMode.AUTO. But are there consequences of not using FlushMode.AUTO with CMT? can data be corrupted? - lost update problem happens with isolation level READ_COMMITTED. Hibernate uses ...

38. Concurrency Control in Web Application    forum.hibernate.org

Hi people, I have a doubt on concurrency control for a web application: Suppose i am updating an object with id X. I just opened a new form and i'm editing the data. The problem is that i'm too slow, and Mr. M also wants to update the same data as i. As he is much faster, he did everything and ...

39. Concurrency Problem in a web application using Hibernate    forum.hibernate.org

We have a web application built using J2EE platform. We are using Hibernate 3.0 for persisting the data in the backend which is Oracle.Our application comprises of web pages where in multiple users can edit and update simultaneously. Scenario : User A, takes a student information to update the address details At the same time, User B takes the same student ...

40. Hibernate concurrency problem    forum.hibernate.org

Hello, I have two message driven beans and both of them persist entity through entity manager. Both message driven beans work in scope of one shared jta transaction. In this special case is it possible to call EntityManager.persist in those mdbs concurrently or shall I have to synchronize access to entity manager? Thanks for answer Best regards Pavel Kadlec

41. Optimistic concurrency    forum.hibernate.org

Hi. We are trying to get optimistic concurrency setup on a project that use JSF, Spring and Hibernate. We've added a version field (INTEGER) to our database table, and added these annotations to the persistance object (the BO layer): @Version @Column(name="version", nullable=true, length=10) protected Integer version; (Using the typical BO->BL->VO->Managed Bean architecture.) But for some reason, the version field does not ...

42. Optimistic concurrency    forum.hibernate.org

I will be using Session per request pattern for my application. My question is more of a doubt on how optimistic concurrency works and less about Hibernate. I am using a dedicated timestamp column with source="db" and generated="always". Consider the following scenario: User 1 in session 1 creates a new object foo and saves it. timestamp = 1 is set by ...

43. Concurrency Problem in Hibernate Application    forum.hibernate.org

I have created hibernate application using EntityManager and Annotations based API. I am adding record in database, so its working fine. But, when i tried to send 5-6 request at same time then i am getting some exception. My Code is : public class Transaction { public boolean createEntity(Object object){ EntityManager entityManager = null; EntityTransaction transaction = null; boolean isCreated = ...

44. Possibly optimistic concurrency control problem    forum.hibernate.org

Hi everybody, in our freshly build Java B2B-Shop-Customer-System (build from scratch, based on Hibernate. Spring etc.) we have four adresses in the MS-SQL-DB (MS-SQL-2000): contact_address, company_address, delivery_address, billing_address. In the end-customer's registration process the following happens (in case the customer says that the delivery_address + billing address is being assembled out of the contact/-delivery_addresses and doesn't have to fill it seperately): ...

45. Concurrency problems    forum.hibernate.org

Hi everyone, I'm experiencing concurrency problems - the following error occurs. Does tx.commit() close the session? I have experienced errors that the session is already closed after tx.commit, session.isOpen returns closed after tx.commit also. Code: 2009-06-18 19:53:14,328 ERROR [org.hibernate.AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session) ...