• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate session management

 
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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!