relationship « Transaction « JPA Q&A





1. Hibernate 1:M relationship ,row order, constant values table and concurrency    stackoverflow.com

table A and B need to have 1:M relationship a and b are added during application runtime, so A created, then say 4 B's created. Each B instance has to come in order, ...

2. Using @Version column does not allow @ManyToOne relationship property as a reference    stackoverflow.com

I'm using hibernate 3.6.3.Final. I have two relational entities A & B with a unidirectional ManyToOne defined as:


@Entity public class A {
...
@Version @Column ( name = "ChangeNumber" )
public Long getVersion() { ...

3. MTM relationships + delete within the same Transaction    forum.hibernate.org

Newbie Joined: Sun Jul 10, 2005 10:20 am Posts: 17 Location: London Hi all, I've got the following test code: Code: @Test(groups = { "integration" }) public void testDeleteRoleWithGroups() throws Exception { Group group = new Group(NULL_ID, GROUP_NAME); Long groupPk = groupDao.saveOrUpdate(group); Role role = new Role(NULL_ID, ROLE_NAME); role.addGroup(group); ...

4. Container and Hibernate Transaction relationship    forum.hibernate.org

A Transaction is started from an EJB as a Container Managed Transaction and then I call a DAO to execute some Hibernate code: - is the Hibernate code implicitly part of the EJB transaction, or do you still have to call session.beginTransaction() within the Hibernate code to join the transaction already in progress? If the EJB transaction rolls back, is the ...

5. Urgent!!!! Parent-Child relationship deadlock    forum.hibernate.org

Hi there, I am facing deadlock issues when more than 1 thread is trying to do parent.addToChild(child) in a transaction. According to the stacktrace and sql that is shown on the console, i got a "net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection" when a parent.addToChild(child) method is called. which is caused by Caused by: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/SUN] SQL0911N T he current ...

6. Concurrency in parent/child relationships    forum.hibernate.org

Suppose we have a parent/child relationsship and a bidirectional mapping properly set. When I load a parent object I also get a list of all childs. Now I want to delete the parent and all it associated childs. But in the meantime another user has added an new child to the same parent. So this child is not in the child ...

7. Parent-Child relationship and versioning(Transaction is not    forum.hibernate.org

Hi, I've got a parent table say "parent_table" and a child table say "child_of_parent_table". I am having a column say "version_no" in parent_table for version for "Optimisstic Concurrency Control". My problem is that when I update only parent record then optimisstic concurrency control is achived properly but when I add a new child record or edit an existing child record, I ...

8. Updating a transaction with a one-to-many relationship    forum.hibernate.org

Newbie Joined: Thu Jul 03, 2008 9:29 am Posts: 2 Hello all, I am having a problem with saving an object because the object has a one-to-many relationship. The problem seems really simple but I keep getting the error: Illegal attempt to associate a collection with two open sessions. My code and mapping files are below. If I take out the ...