saveOrUpdateCopy « Update « JPA Q&A





1. saveOrUpdate and saveOrUpdateCopy    forum.hibernate.org

2. saveOrUpdateCopy,saveOrUpdate NullPointerException    forum.hibernate.org

Newbie Joined: Wed Aug 27, 2003 3:09 am Posts: 17 I tried to persist an object using session.saveOrUpdateCopy(completedTask,completedTask.getId()); I got NullPointerException. However, if i use save(), no problems occur. Here is a stack trace Code: hk.hku.csis.biosphere.webservices.buffer.BufferException: hk.hku.csis.biosphere.webservices.buffer.PersistenceException: net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) getter of hk.hku.csis.biosphere.webservices.buffer.CompletedTask.? at hk.hku.csis.biosphere.webservices.buffer.CompletedTaskBufferImpl.putCompletedTask(CompletedTaskBufferImpl.java:41) at ...

3. saveOrUpdateCopy with different database?    forum.hibernate.org

Hello all, I am trying to use hibernateSession.saveOrUpdateCopy to copy objects from one database to another. Code: User test = (User) originalSession.load(User.class, new Long(3065)); try { ...

4. saveOrUpdateCopy fails    forum.hibernate.org

Hi all, I have a problem with calling sesion.saveOrUpdateCopy(obj) my class is the following: public class Collateral { private Long id; private String text; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getText() { return text; } public void setText(String text) { this.text = text; } } mapping is the following: ...

5. saveOrUpdateCopy doesnt work    forum.hibernate.org

Hi, I am using saveOrUpdateCopy() for saving Company object. The company object contains contact object. How ever when i try to save the company object using saveOrUpdateCopy() i get the following error: "exception setting property value with CGILIB (set hibernate.cgilib.use_reflection_optimizer=false for more info) getter property com.Contact.?" I tried to set the hibernate.cgilib.use_reflection_optimizer to false in hibernate.cfg.xml however i still cannot see ...

6. classcastexception (save and saveOrUpdateCopy)    forum.hibernate.org

hi, i am getting the following exception when i try to use Session.saveOrUpdateCopy. the interesting part on it does not happen if i use simply Session.save which is even more interesting since i am quite sure that i have closed the session i loeaded the object from. java.lang.ClassCastException at net.sf.hibernate.type.EntityType.resolveIdentifier(EntityType.java:213) at net.sf.hibernate.type.EntityType.copy(EntityType.java:141) at net.sf.hibernate.type.TypeFactory.copy(TypeFactory.java:284) at net.sf.hibernate.impl.SessionImpl.doCopy(SessionImpl.java:3990) at net.sf.hibernate.impl.SessionImpl.saveOrUpdateCopy(SessionImpl.java:3938) any ...

7. Difference between saveOrUpdate and saveOrUpdateCopy    forum.hibernate.org

Hibernate version: 2.1 Mapping documents: Code between sessionFactory.openSession() and session.close(): Full stack trace of any exception that occurs: Name and version of the database you are using: Debug level Hibernate log excerpt: What is the difference between the 2? Here is the scenario : In this case I load up an existing store object from the db into the Hibernate session, ...

8. saveOrUpdateCopy throws NPE if persister.isUnsaved is wrong    forum.hibernate.org

This isn't really a bug, but perhaps Hibernate should recover more gracefully. Here's how to reproduce it: Write some code that (1) saves an object, (2) sleeps for 30 seconds. Sneak behind hibernate's back and delete the object from the database. (3) call saveOrUpdateCopy on a copy of the object. Hibernate throws a NullPointerException. The problem occurs in the doCopy code ...

9. saveOrUpdateCopy conundrum    forum.hibernate.org

Hibernate version: 2.1.6 Hi Folks - I am working on migrating many EJBs to hibernate entities. Along the way, there are a few spots where we check for differences in the old version and new version of an entity before it is saved - for instance, when checking permissions or auditing the save. In any case, our work flow for a ...





10. saveOrUpdateCopy problem    forum.hibernate.org

Beginner Joined: Tue Aug 26, 2003 6:24 pm Posts: 45 Hibernate version: 2.1.6 Hi Folks - this is in relation to the issue of choosing between using session.saveOrUpdate() and session.saveOrUpdateCopy(). Skip to the bottom for my implemented workaround - its very hacky, but I don't see a better way to handle the situation. We have a system that operates fairly simply ...

11. ClassCastException updating object with saveOrUpdateCopy    forum.hibernate.org

Author Message youngm77 Post subject: ClassCastException updating object with saveOrUpdateCopy Posted: Tue Nov 16, 2004 8:27 pm Regular Joined: Thu Aug 26, 2004 9:23 pm Posts: 71 Hibernate version: 2.1.6 I have a one-to-one relationship between User and Principal. If I modify a detached version of User and call session.update(user); then everything works perfectly fine. However, if I attempt ...

12. Status 'saveOrUpdateCopy'-Bug (confirmed by Gavin)?    forum.hibernate.org

Expert Joined: Tue Oct 05, 2004 9:45 am Posts: 263 okay ...i could provide some more information now and would be glad if someone could tell me why that doesn't work with 'saveOrUpdateCopy' ... mapping-files Code:

13. saveOrUpdateCopy: object identity broken?    forum.hibernate.org

Expert Joined: Tue Oct 05, 2004 9:45 am Posts: 263 Hibernate version: 2.1.7 Mapping documents: Code:

14. saveOrUpdateCopy memory leak?    forum.hibernate.org

Anyone knows if the Session.saveOrUpdateCopy call causes memory leak? We have the following persistent object model: class A { Set Bs; // A has a one-to-many relationship with B } class B { A a; // many-to-one side of A } Somehow, we ran into a case (after the following code): A a = session.saveOrUpdateCopy(A); The new A object saveOrUpdateCopy() returns ...

15. difference between saveOrUpdate and saveOrUpdateCopy    forum.hibernate.org

Hi all, I'm trying to undestand the difference between saveOrUpdateCopy and saveOrUpdate session method. I'm currently reading the HIA chapter 4(Working with persistence Object) and I'm still doubtfull of my undestanding about theses two methods. I've made basic testing to help me clarifying things. But I'm getting the same results (calling on saveOrUpdate or saveOrUpdateCopy). So I'm wondering if someone could ...

16. saveOrUpdateCopy can save a new. but saveOrUpdate can't. why    forum.hibernate.org

saveOrUpdateCopy can save a new Object, but saveOrUpdate can't save a new object? why? public void testSaveOrUpdate() { PigeonholeType pigeonholeType = new PigeonholeType(); pigeonholeType.setSymbol("none"); PigeonholeRule pigeonholeRule = new PigeonholeRule(); pigeonholeRule.setXtypeSymbol("SB006"); pigeonholeRule.setSize(new Integer(0)); pigeonholeRule.setPigeonholeType(pigeonholeType); pigeonholeRuleDao.saveOrUpdate(pigeonholeRule); } public Serializable saveOrUpdate(PigeonholeRule obj) throws HibernateException { session = sessionFactory.openSession(); x = session.beginTransaction(); session.saveOrUpdateCopy(obj); tx.commit(); } [WARN ] [2005-03-14 11:28:01,750] net.sf.ehcache.config.Configurator - No configuration found. Configuring ...





17. saveOrUpdateCopy and LazyInitializationException    forum.hibernate.org

18. recommendation for use of saveOrUpdateCopy    forum.hibernate.org

19. bugfix in hb2? saveOrUpdateCopy    forum.hibernate.org

Hibernate version: 2.1.8 Full stack trace of any exception that occurs: Code: net.sf.hibernate.NonUniqueObjectException: a different object with the same iden tifier value was already associated with the session: 1108, of class: de.test.ClassC at net.sf.hibernate.impl.SessionImpl.checkUniqueness(SessionImpl.java:16 87) at net.sf.hibernate.impl.SessionImpl.doUpdateMutable(SessionImpl.java:14 53) ...

20. saveOrUpdateCopy and too many updates    forum.hibernate.org

Hibernate version: 2.1.8 I have a simple Parent/Child relationship, single collection from parent to child, and single association back from the child to the parent. All other properties on both objects are simple. Both objects are versioned using a version number. The parent side of the collection (i.e. the set) is marked as inverse = true. I'm using a think client ...

21. saveOrUpdateCopy() and merge() differences    forum.hibernate.org

Hi all! I need to persist a deeply nested object graph (5-6 levels). Objects in some levels could have been already persisted while others are new to the session. With hibernate 2.x I did a saveOrUpdateCopy() of the graph. According to the migration guide I should do a merge() with hibernate 3.x. But the fact is that for cases as A--*B--*C ...

22. 2.x to 3.05 -- merge() instead saveOrUpdateCopy()    forum.hibernate.org

Author Message balderman Post subject: 2.x to 3.05 -- merge() instead saveOrUpdateCopy() Posted: Sun Apr 30, 2006 3:41 am Beginner Joined: Fri Feb 24, 2006 12:52 pm Posts: 30 When I call session.merge() I get : org.hibernate.PropertyValueException: not-null property references a null or transient value: com.bmc.idm.cmplmgr.bo.common.PolicyImpl.name Hibernate version: 3.05 Mapping documents: