• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate session management  RSS feed

 
Swapnil Dharane
Ranch Hand
Posts: 55
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys
I am trying an example for one to many mapping using below code:


Here,for the first round of execution,3 components are getting inserted with componentId 0,1,2 .But While trying to reinsert, increment operation starts at 0 itself and a 'MySQLIntegrityConstraintViolationException' is thrown.
I have two guess about this case:

1.increment generator is starting at initial position for every execution
OR
2.insertions in Components table are not being commited.
Can anyone help me figure out the real problem
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!