key « Transaction « JPA Q&A





1. Optimistic Lock Exception with Foreign Keys    stackoverflow.com

We are using JEE5 with GlassFishV2.1 and MySQL 5.1 and this is related to OptimisticLockException that we get. We have two database tables. First table is USER: having UserId and EmailId columns. ...

2. Concurrent Data Insertion Problem, Primary Key Duplicated    forum.hibernate.org

User A and User B both "entered their client data" and "saved it one after the another". The error as the following appeared: "Duplicate key or integrity constraint violation". This problem was found when they seem to access the same table and started adding data from the same row: 1. When both of them access the database at table XYZ, hibernate ...

3. oracle deadlock because of missing foreign key index    forum.hibernate.org

public String getAddForeignKeyConstraintString( String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey, boolean referencesPrimaryKey ...

4. auto-generated primary key causing commit to fail?    forum.hibernate.org

I'm having a problem getting hibernate to commit a new object to the database when the database is set up to generate the primary key (the ID field) upon insertion. The column rowguid in the Antennas table is of type uniqueidentifier. I've mapped that to a string for lack of a better option. It looks like the ID is being generated ...

5. Handling duplicate key in concurrent context    forum.hibernate.org

Hi, I'm trying to figure out how I can solve the following problem. Here is the situation. I have 2 entities: delivery and user. The relationship between these entities is many to one: multiple deliveries for one user. When the application persist a delivery, the associated user is either created or the existing one is referenced via a retrieval since users ...

6. Solution to foreign key constraint exception on commit    forum.hibernate.org

Author Message nbsherid Post subject: Solution to foreign key constraint exception on commit Posted: Tue Jul 24, 2007 10:05 pm Newbie Joined: Sat Jan 13, 2007 5:09 am Posts: 2 Location: Sydney, Australia Hi, I have solved foreign key constraint exceptions using other approaches before, but this one was particularly tricky (14 hours of debugging!) The process was as ...

7. Creating Enumeration Tables for Foreign Key Locking    forum.hibernate.org

Hibernate version: 3.2 Name and version of the database you are using: H2 1.0.57 I have a number of objects in my model that use enumerations (both JDK5.0 and some JDK 1.4 Enumeration Patterns (ala Bloch and Simmons). What I would like to do is have hibernate create a table in the schema that contains the enumeration and has the values ...

8. foreign key issue in one transaction, please help    forum.hibernate.org

Hey guys, I'm having problem getting the scenario below working in one transaction. Assume: Table #1 - "salesTable" Table #2 - "salesHistory" salesTable has the following composite ID (customerId, salesId) note# customerId is known before hand, salesId is generated (+1) during each insert. salesHistory has the same composite ID (customerId, salesId) I need the salesId in the salesHistory to be the ...