Reference « Collection « JPA Q&A





1. Threadlocal reference to hibernate session impl, causing session impl not to get garbage collected    stackoverflow.com

I am using thread local to manage my hibernate sessions. Recently I have been seeing OutOfMemory exceptions on my production server. I ran Eclipse MAT on the heap_dump and saw a ...

2. multiple condition in referencing collection in object using JPA    coderanch.com

Hi i am using hibernate impl for JPA. i have been with this issue i have a database table classified with have all the details about classified. There is classified_attribute table which stores the attribute_code and value_code for a specific classified Classified_attribute Table i have a classified object in that i have a classifiedAttribute collection. The classifiedAttribute collection has classifiedAttribute object. ...

3. Hibernate: Found Shared References to a Collection    coderanch.com

I started with the following three tables: Customer Roles Customer_Has_Roles In the Customer.hbm.xml, I have the following: In the Role.hbm.xml, I have the following: The above configuration is working in my application, but I want ...

4. Example criteria with collection references    forum.hibernate.org

5. Shared references to a collection    forum.hibernate.org

net.sf.hibernate.HibernateException: Found shared references to a collection at net.sf.hibernate.impl.SessionImpl.updateReachableCollection(SessionImpl.java:2759) at net.sf.hibernate.impl.FlushVisitor.processCollection(FlushVisitor.java:32) at net.sf.hibernate.impl.AbstractVisitor.processValue(AbstractVisitor.java:69) at net.sf.hibernate.impl.AbstractVisitor.processValues(AbstractVisitor.java:36) at net.sf.hibernate.impl.SessionImpl.flushEntity(SessionImpl.java:2474) at net.sf.hibernate.impl.SessionImpl.flushEntities(SessionImpl.java:2340) at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2207) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2186) at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)

6. "You may not change the reference to a collection with.    forum.hibernate.org

Scenario: I have a Customer object which is attached to many UserLogin entities with a all-delete-orphan collection. I have a test where a newly created customer goes through a number of updates without problems. But if I re-load the customer object using the same id, and try to re-do some of those operations, I receive the 'you may not change the ...

7. Running with scissors...shared references and collections.    forum.hibernate.org

This is a little unclear, so to make sure I understand you... In the first snippet, you opened a session, used it to retreive a "review", and then closed the session. You then attempted to read across "review"'s reviewParts collection. Is that correct? Is Review.reviewPart mapped as lazy? Or is Review mapped with a proxy?Either of those would explain the exception. ...

8. why "reassociated object has dirty collection reference    forum.hibernate.org

I have a process that creates a group of GeoGroup objects, at creation time, one of the collections, weightingTreatments, is uninitialized. The session then closes. Later on, another process updates the GeoGroups and creates the weightingTreatments, when I try to update the geogroups i get the reassociated objects are dirty exception. The interesting thing is that the exception occurs on the ...

9. "Found shared references to a collection" misbehav    forum.hibernate.org

Hibernate version: 2.1.6 Mapping documents:





10. Found shared references to a collection    forum.hibernate.org

Hi all, I must insert the objects Company, MonthlyFee and Transaction Tax. Im trying to insert objects into database, but occurs the problem specified bellow when, in the java code, I try to execute dataSource.insert(monthlyFee, session); Hibernate version: 2.0.2 Mapping documents: Code:

11. Found shared references to a collection    forum.hibernate.org

12. Found shared references to a collection    forum.hibernate.org

13. Found shared references to a collection    forum.hibernate.org

I have noticed this is a common problem and the solution is not to share the entities between different collections. I have somewhat different situation I think, I have a transaction that include the creation of several objects, in the same transaction using the PROPAGATION_REQUIRED type i try to query for certain elements that were not loaded before and get the ...

14. Why are shared references to collections bad?    forum.hibernate.org

This conversation thread explains the cause of the exception "Found shared references to a collection": http://forums.hibernate.org/viewtopic.php?t=944335 However, I'm curious as to why shared references to collections are a problem? Is there something inherent in DB relations that make it impossible, or is it a design decision by the Hibernate team to encourage best practice? In short, why does Hibernate throw an ...

15. You may not change the reference to a collection with ....    forum.hibernate.org

Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message mtkmarcos Post subject: You may not change the reference to a collection with .... Posted: Thu Dec 29, 2005 12:09 pm Newbie Joined: Fri Dec 16, 2005 10:51 am Posts: 4 <

16. Need to allow shared references to collections    forum.hibernate.org

Is there a way to allow shared references to collections? Is there a reason for not allowing this, even when the collection is read-only(should nver be updated to database)? Or do I have to remove the mappings and instead load these collections from hql? (Means a lot of code we'll have to change..) Anybody out there with a solution to this ...





17. "reassociated object has dirty collection reference&quo    forum.hibernate.org

Hibernate 2.1.8, Spring 1.2.6. In my webapp I have a Parent object which contains a Children collection which I've just switched to 'lazy=true'. I need to store the Parent object in the HTTP session, do something with a Child (in another request) and then retrieve the Parent object from the HTTP session and update the Children collection with the new version ...

18. reassociated object has dirty collection reference    forum.hibernate.org

Yes there is a reason. I want to minimize outside dependencies to hibernate. An example for such a dependency is: 1. (business layer) begin transaction 2. (persistence layer) read an object A with session.get() 3. (business layer) do things, e.g. clone A towards A' (same id as A) 4. (persistence layer) store objects e.g. A' 5. (business layer) commit transaction If ...

19. Found shared references to a collection    forum.hibernate.org

I have a nxm relationship with bidirecional navigation. Company(n) and employee(m) Company have a collection of employees. I create a new company and a new collection of employees. In this new collection I add the employees of the original company and add new ones. All of the time session is opened. I have a cacade=save-update. When I tried to save the ...

20. How to reference a collection of elements using Criteria API    forum.hibernate.org

Hibernate version: 3.1.1 Hi, I have been struggling with the following issue for some time, I am hoping that someone can point me in the right direction: I have an entity (A) which has a one-to-many collection of elements. To make the problem simple lets say that the collection is just a Set of Strings. What I want to do is ...

21. Don't change the reference to a collection...    forum.hibernate.org

Regular Joined: Mon Jul 26, 2004 2:28 pm Posts: 86 Location: Pensacola, Florida Getting "org.hibernate.HibernateException: Don't change the reference to a collection with cascade="all-delete-orphan": foo.pkg.Order.references" Looking at the Hibernate source, this is thrown if the owning entity key changes or if the currentPersister is not the same as the loadedPersister. My code loads an Order (implements DocumentHolder) in one request and ...

22. reassociated object has dirty collection reference    forum.hibernate.org

Newbie Joined: Fri Oct 20, 2006 12:55 pm Posts: 12 Hello, I've been trying to update an Agent class with a set of Role (s). I've : 1. read through these forums for issues related to updating entities with collections 2. I've read through the examples and hibernate tests 3. Googled this for the past 12 hours ..and still I cannot ...

23. retrieving collection reference by invoking own Java method    forum.hibernate.org

Hi, I have a 1-n relationship from entity A to entity B. i.e A holds a collection of B. I do not have auto-retrieve (lazy=true) set up for B's collection on A's POJO. I would however like B's collection to be retrieved and populated on A when A is constructed by invoking a given Java method on a facade. Essentially, I'd ...

24. reassociated object has dirty collection reference    forum.hibernate.org

Hi there, Error: "reassociated object has dirty collection reference (or an array)" - what does this mean? Obviously it's happening when I attempt to reattach an object to the session. I'm assuming it means the object I am attempting to reattach has a reference to a dirty collection/array. In this context what does "dirty" mean? Cheers Lord0

25. Need support for shared references/shared collections    forum.hibernate.org

Hibernate version: Hibernate 3.2.2ga Hi all, imaging the following model: 1 Person has n Versions of a Person Person 1 - n PersonVersion 1 PersonVersion has one Version of an Address PersonVersion 1 - N Address 1 Address has n Versions of an Address Address 1 - n AddressVersion The attributes of e.g. a person are immutable. If an attribute must ...

26. Shared collections on self-referencing tree    forum.hibernate.org

hi all. I have a tree structure of Folders (parent child) and each folder can be tagged with a tag (Tags collection of Folder). That's all fine .. Now I would like that all children folders have the same tags as the parent ... Basically I just need to point the Tags collection to the one of the parents tags Code: ...