row « Transaction « JPA Q&A





1. How to lock a transaction for reading a row and then inserting in Hibernate?    stackoverflow.com

I have a table with a name and a name_count. So when I insert a new record, I first check what the maximum name_count is for that name. I ...

2. How to make DB return different rows for subsequent transactions?    stackoverflow.com

I have the below flow in a multi-threaded environment

  1. start transaction
  2. read n number of top rows (based on a column) from db
  3. check some criteria
  4. update those set of rows
  5. commit/rollback the transaction
I am using ...

3. Hibernate - Row was updated or deleted by another transaction..    coderanch.com

(or unsaved-value mapping was incorrect) for test.OrderItem instance with identifier: 654321 Hi, I am getting the above mentioned error message when trying to save a parent/child many-to-one association. Could anyone please tell me what i am doing incorrectly? I have specified the database I am using, the hibernate maps and errors I am getting in hibernate below. many thanks in advance ...

4. Row level lock in Hibernate    coderanch.com

I have NOT mentioned explicitly any locking configurations in Hibernate. But whenever queries are fired through Hibernate i see logs similar to the one below: [B]2005-12-09 16:08:17, 645 DEBUG [net.sf.hibernate.SQL] LOCKING TABLE SM_TABLE_RUN FOR ACCESS [/B] select smTABLEr0_.TABLE_ID as TABLE_ID__, smTABLEr0_.TABLE_VERSION_ID as TABLE_2___, smTABLEr0_.RUN_ID as RUN_ID__, smTABLEr0_.TABLE_ID as TABLE_ID0_, smTABLEr0_.TABLE_VERSION_ID as TABLE_2_0_, smTABLEr0_.RUN_ID as RUN_ID0_, smTABLEr0_.UPDATE_DTTM as UPDATE_D4_0_, smTABLEr0_.RUN_TYPE_CD as RUN_TYPE5_0_, ...

5. Hibernate 2: locking a row    coderanch.com

Hi, I need to synchronize object access between 2 VMs. So I added a special state field that can be "PROCESSING", "NOTPROCESSING". When it is "NOTPROCESSING" it can be grabbed from the database by one of the VMs and the field of that object will be st to "PROCESSING" so now my code can continue execute because this object will not ...

6. Hibernate & Row Locks Problem    coderanch.com

Yesterday one of our applications stopped working. It's working now, but I've no idea why it stopped working, and why it's just started working. I'm posting here to see if anyone can shed any light. The application runs on tomcat 6.0.20 and uses Hibernate 3.2.1, connecting to Oracle 10.1. The application has a very small number of users (~20 or so, ...

7. switch to hibernate: Row was updated or deleted by another transaction    java.net

we create some entity, get it by id then. Then we alter some of its fields and try to save it for further look up and check if fields entity was saved with new field values. But on update method call we get: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [...Account#7379] at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1769) at ...

8. Sybase row level locking    forum.hibernate.org

9. Row was updated or deleted by another transaction    forum.hibernate.org

Hi, I am getting a org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect). I have a previously created object Permission which is saved to a User just fine. When I go to update the object in get the above error message. I was wondering how I can resolve this issue. Before each save or update ...





10. Locking of rows    forum.hibernate.org

Hi, I have recently developed a simple sales order application. This is hosted on web. Now I want to make sure that only one person is editing one sales order(instance) at one time. If any other user tries to edit I want to show him a message. Is there any way that hibernate tells that a particular instance is locked or ...

11. Hibernate optimistic locking and one-row-per-version legacy    forum.hibernate.org

Hi, I am trying to use Hibernate with oprtimistic locking against a db2 database that is being populated by rpg. The rpg program creates a new row for each version and the rows contain a flag to specify which version is the active version. Hibernate's versioning updates one row with new values and increments the version number of this one row. ...

12. Regarding row locking    forum.hibernate.org

13. Row lock in Web Editing    forum.hibernate.org

Hallo, i'm using JBoss+Hibernate for a database editing application! I'd like to lock a row when i get it from the database; in this way no one can get this row until the update. But i'd like also to develop a timeout system that release the row after 3 minutes. Do u have any idea? Thanx for any help! Gio

14. Is row level locking available in hibernate?    forum.hibernate.org

15. Row was updated or deleted by another transaction....    forum.hibernate.org

Regular Joined: Fri Oct 08, 2004 4:11 am Posts: 78 Location: Nottingham, England (or unsaved-value mapping was incorrect) for test.OrderItem instance with identifier: 654321 Hi, I am getting the above mentioned error message when trying to save a parent/child association. Could anyone please tell me what i am doing incorrectly? many thanks Andrew Hibernate version:2.1.1 Mapping documents: Order.hbm.xml ...

16. Concurrent delete on same row exception    forum.hibernate.org

Hibernate version : latest hello there, i am writing code to ensure that when 2 users are deleting the same record at the same time, i want to be able to make sure that the second delete of the same record, which will definitely fail (cos the first delete will pass) is handled properly. I have tried LockMode.upgrade to prevent the ...





17. Does hibernate support row level or table level locking?????    forum.hibernate.org

Does hibernate support row level or table level locking????? I using "WAP T" as a testing tool to test a test case scenario wuth HIBERNATE 2.1.6 and MYSQL 4.0 as database. The scenario is that 10 simultaneous users are trying to insert 100 records each. I am having servlet where i have a loop from 1 to 100, to insert records ...

18. versioning for optimistic locking without locking the DB row    forum.hibernate.org

gavin wrote: I think you are mistaken. INSERTs never block other INSERTs, especially not in read committed. I have seen scenarios in which the whole file is locked, not in Hibernate but with EJB's. Of course in the normal state of affairs, a locked row on an insert makes no sense at all. It could be that someone thinks they are ...

19. updating row multiple times in a single transaction    forum.hibernate.org

Hello, I need to update a row several times during one transaction. For concurrency control I use versioning. The problem is that when I call save method on the second update I get StaleObjectStateException. As far as I see, the problem is in incremented version number that Hibernate doesn't like, so it thinks that the object is stale. Is there some ...

20. hibernate is updating rows unexpectedly (causing deadlocks)    forum.hibernate.org

Author Message mxnmatch Post subject: hibernate is updating rows unexpectedly (causing deadlocks) Posted: Wed May 04, 2005 7:14 pm Beginner Joined: Fri Dec 17, 2004 8:30 pm Posts: 20 I've posted several questions about this on experts exchange, but so far have not gotten any answers. For a full history of my questions, see: - Most recent: http://experts-exchange.com/Programming/Programming_Languages/Java/Q_21410535.html - ...

21. Row was Updated by another transaction    forum.hibernate.org

Author Message bob33 Post subject: Row was Updated by another transaction Posted: Thu Jul 28, 2005 3:42 am Newbie Joined: Mon Nov 22, 2004 6:24 am Posts: 3 Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: hibernate 2.1.4 Mapping documents: Mapping of client fiche :

22. Pessimistic row-level locking    forum.hibernate.org

Hibernate version: Hibernate 3.0.5 I'm trying to accomplish database row-level locking for a table using a Hibernate entity similar to what could be done with an entity bean. Is this possible? I read in the documentation about getting an upgrade lock, and this is certainly seems feasible, but that leaves two questions: 1) Can this be specified declaratively in the mapping ...

23. Row level locking in Hibernate    forum.hibernate.org

Hi, I am using Hibernate-2.1.3 Code: 2005-10-28 11:18:05,860 DEBUG [net.sf.hibernate.SQL] LOCKING TABLE CR_EXECUTION_LIST FOR ACCESS select crexecutio0_.PROCESSING_ENGINE_ID as PROCESSI1___, crexecutio0_.PROCESSING_ENGINE_VERSION_ID as PROCESSI2___, crexecutio0_.EXECUTION_LIST_ID as EXECUTIO3___, crexecutio0_.PROCESSING_ENGINE_ID as PROCESSI1_0_, crexecutio0_.PROCESSING_ENGINE_VERSION_ID as PROCESSI2_0_, crexecutio0_.EXECUTION_LIST_ID as EXECUTIO3_0_, crexecutio0_.UPDATE_DTTM as UPDATE_D4_0_, crexecutio0_.Component_Id as Componen5_0_, crexecutio0_.Component_Version_Id as Componen6_0_, crexecutio0_.Component_Type_Cd as Componen7_0_, crexecutio0_.Application_Sub_Type_Cd as Applicat8_0_, crexecutio0_.Priority_Ord as Priority9_0_, crexecutio0_.Logon_User as Logon_User0_, crexecutio0_.Logon_Password as Logon_P11_0_, crexecutio0_.Tap_Job_Id as Tap_Job_Id0_, ...

24. Row was updated or deleted by another transaction    forum.hibernate.org

I just wanted to write about what was happening to me with this exception: net.sf.hibernate.StaleObjectStateException. It threw this message: Row was updated or deleted by another transaction I think that this exception can be thrown in this case and I was going mad with it: 1) Open a session to make an hibernate query 2) Execute a query wich returns a ...

25. Insert then update on same row in bean tx leads to deadlock    forum.hibernate.org

Regular Joined: Wed Jul 27, 2005 2:33 am Posts: 118 Hibernate version: 3.1.2 Name and version of the database : MS SQL Server 2000 Datasource implmentation class being used : com.sap.nwmss.jdbcx.sqlserver.SQLServerDataSource We are using SAP NetWeaver Application Server 6.0 and Hibernate 3.1.2 in our application. We have StalessSessionBeans which use Hibernate to interact with the database. We are running into a ...

26. READ LOCK on row.    forum.hibernate.org

27. Row was updated or deleted by another transaction exception    forum.hibernate.org

I have two pojos, both of them have a collection bids. What I want is to remove an element from this collection so I am using the following code: Session session = HibernateUtil.getCurrentSession(); Thing thing = session.load(Thing.class, thingId); Item item= session.load(Item.class, itemId); thing.getBids().remove(bid); item.getBids().remove(bid); session.save(thing); session.save(item); session.close(); In my mapping files (Item.hbm.xml, Thing.hbm.xml) I have in the set tag of the ...

28. Row locking design question    forum.hibernate.org

Hi, I have a requirement to lock rows after they have been selected until they have been processed. When they have been processed they will either be updated or deleted and this marks the end of the transaction. So: select x from y - This marks the start of the transaction Perform some business logic update / delete y where x ...

30. Row level locking    forum.hibernate.org

Hi, I have a distributed web application (same app is running on two different servers). I'm using a MySQL 5.0 database. I would like to be able to aquire a row level lock on the database from my code (to make sure that just one thread at a time have access to a row). Is this possible through Hibernate (Im using ...

31. Commit 180.000 rows    forum.hibernate.org

I made an small application which will copy data (180.000 rows) from AS400 DB2 to MySQL database. The application is built using hibernate and spring. However, the commit operation take about 30 - 60 minutes (1 hour). For those 180.000 rows, is this time normal? Is there any way to improve the commit operation? Thanks in advance