[jboss-user] [JBoss Seam] - Re: modify entity after persist from same method

jsutherland do-not-reply at jboss.com
Thu Jan 24 18:41:08 EST 2008


Pete,

Because when I do that I get transient instance problems:


  | 19:33:15,893 INFO  [STDOUT] Hibernate: 
  |     insert 
  |     into
  |         User_Calendar
  |         (users_id, calendars_id) 
  |     values
  |         (?, ?)
  | 19:33:15,895 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
  | org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.vivapop.calendar.entity.Calendar
  | 	at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
  | 	at org.hibernate.type.EntityType.getIdentifier(EntityType.java:397)
  | 	at org.hibernate.type.ManyToOneType.nullSafeSet(ManyToOneType.java:78)
  | 	at org.hibernate.persister.collection.AbstractCollectionPersister.writeElement(AbstractCollectionPersister.java:755)
  | 	at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1143)
  | 	at org.hibernate.action.CollectionRecreateAction.execute(CollectionRecreateAction.java:26)
  | 	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
  |  ...
  | 

I searched hibernate forums about this and couldn't seem to find anything related ?  



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4123265#4123265

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4123265



More information about the jboss-user mailing list