collection « Transaction « JPA Q&A





1. problem with hibernate optimistic lock and collections    stackoverflow.com

I have a problem using optimistic locking. I have a persistent object, with a version number. I want this version number to be increased only when my persistent object is 'really' ...

2. Locking a collection in Hibernate    stackoverflow.com

I have got a session bean method that uses Hibernate to add child to a indexed collection of an entity. However, since there may be multiple threads accessing the method at ...

4. Concurrent updates to an entity an its collections    forum.hibernate.org

Hi! I'm new to the forum and I want to ask a question that maybe is simple but I don't have so much experience with hibernate. I'm using hibernate 3.3 with session beans in a Jboss environment (JTA). I'm in a situation where there could be cocurrent updates to an entitiy and sometimes some changes aren't commited to the database, and ...

5. problem with optimistic lock and collections    forum.hibernate.org

Hi all, I have a problem using optimistic locking. I have a persistent object, with a version number. I want this version number to be increased only when my persistent object is 'really' updated, meaning when one or more fields have been modified or when a collection mapped in my entity with a @ManyToOne or @OneToMany annotation is modified in the ...

6. Are transactions needed for collection iteration read-only?    forum.hibernate.org

My application uses a JDBC connection and it only has one thread (main) at the moment. The service methods commit the changes whenever required. There are some places where iterating the collection is necessary. Based on the result, I may have to change the data (and hence a commit). Given this, should I start a transaction before the collection is read? ...

7. Lazy collections are loaded during commit    forum.hibernate.org

In my application I am loading some of the objects that are needed in that session and creating new object. During save we haven't seen insert statement. Finally during the transaction commit, I noticed that lazy collections of the retrieved objects are loaded though they were not accessed. What could be wrong? Note: I am using 2.1 final and show_SQL is ...

9. rollback does not roll back collection (one-to-many)    forum.hibernate.org

Author Message koes Post subject: rollback does not roll back collection (one-to-many) Posted: Tue Nov 02, 2004 3:57 pm Beginner Joined: Fri Oct 15, 2004 10:29 am Posts: 21 I want to rollback a "Session" object (not to be confused with a hibernate session) after I've added some "Registration" objects to the roster collection. Calling session.connection().rollback() does NOT rollback ...





10. Concurrent finds / Collection flushing problem    forum.hibernate.org

Hi, I am using Hibernate in a tomcat environment, using a filter to open and close my ThreadLocal hibernate sessions. My root problem is an "Illegal attempt to associate a collection with two open sessions" that has been discussed here in detail. But I did not find any solutions. What I am doing is: 1. Starting a request to find a ...

11. Statistics: Collections are not successful transactions    forum.hibernate.org

Hibernate.initialize(adSlot.getAdSlotAds()); ...

12. Application transaction and collection modification    forum.hibernate.org

Hi, I use Hibernate and everything is fine. I need to know if there is a trivial solution to my probllem. In an application transaction - session-per-request-with-detached-objects I have the following scenario. req1. Group group = session.get(Group.class, idGroup); Person person = new Person(idPerson); group.getPersons().add(person); session.save(person); session.save(group); session.close(); req.getSession().addAttribute("ddd", group); req2. Person person = session.get(Person.class, idPerson); group.getPersons().remove(person); session.close(); req3. // here we ...

13. Collection Cache Entry not Flushed during Rollback ?    forum.hibernate.org

During my testing of an application i observed a strange behavior with cached collections. It seems to me, that the collections changed during a transaction are not flushed / removed at transaction rollback. As far as i can see, changed instances are correctly flushed. This behavior has been observed using EhCache and OSCache. To nail down the problem, i've implemented an ...

14. 2nd level cache - collections are locked?    forum.hibernate.org

15. collection concurrency problem    forum.hibernate.org

I have a unidirectional one-to-many association between an entity 'Media' to an entity 'Comment'. My problem is the classic concurrency problem. When two users adds a comment each to a media, User A's comment gets overwritten by User B. This is the store comment logic. It like a transaction isolation level problem but on a table level instead of one particular ...

16. Could initialize a collection [deadlock detected]    forum.hibernate.org

Our application is made in EJB 3.0 with JBoss 4.2.2 as application server and Postgres 8.2 as Database server. During one of the execution while querying an object using JPQL, I am getting the following exception. This is the first time I have came across such an exception in our application. Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not initialize a collection: [com.barco.cms.service.perspectivemgt.Perspective.mPerspectiveWindows#350] ...