• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

org.hibernate.TransientObjectException

 
nami shekar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i try to update a particular value i am getting the follwing exception

(AbstractFlushingEventListener.java:299) - Could not synchronize database state with session
org.hibernate.TransientObjectException:

And when i tried to trace the code, the commit() was not happening and that point of time the above exception was thrown

Any suggestions or solutions would be of great help

Thanks in Advance
 
ntumba lobo
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I dont know full stack trace my guess would be you have 2 objects linked by an association.
One of them is a persistent and the other is transient and when hibernate tries to flush the session for your update it cant because of the transient object.

Usually the solution is to have a cascade attribute in your association.
Otherwise first make sure to persist the transient object individually first before doing the update on both.
 
nami shekar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You,
As you told, one of the object was transient.
Thanks
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic