• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate error

 
anuja Edathu
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I do have an ArraList tim of object.I want to persist this objects.For that i did the following.


but it is giving the error
org.hibernate .exception. GenericJDBCException
Could not execute JDBC batch update.

Can't i execute insert in a loop?

Help me!
Thanks & Regards,
Anuja K.
[ October 07, 2005: Message edited by: Mark Spritzler ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, now that I added the CODE tags, which is a button under the Add Reply button and added formatting I can see that your commit is inside the for loop.

Where do you start your transaction? I believe it looks like it is outside, before the for loop. So you commit that transaction more times than it has started. Try to move the commit to after the loop.

Mark
 
anuja Edathu
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thank You all,I could solve the problem by moving the commit out of the loop
Regards,
Anuja K.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic