-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Can session.update() throw an exception on inexistence?
PostPosted: Sun Oct 26, 2003 5:45 pm 
Pro
Pro

Joined: Wed Oct 08, 2003 10:31 am
Posts: 247
When session.update() is executed, it doesn't return error when the object being updated doesn't exist in the DB.
This is bad because the client doesn't know if he is updating an existing object or not.

Is there a way to make session.update() throw an Exception without the need to do a session.load(...) before it?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 26, 2003 5:49 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
disable JDBC batch updates.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 26, 2003 6:04 pm 
Pro
Pro

Joined: Wed Oct 08, 2003 10:31 am
Posts: 247
gavin wrote:
disable JDBC batch updates.



hmm... how do I disable jdbc batch updates?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 26, 2003 6:19 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
hibernate.jdbc.batch_size=0 in your hibernate.cfg.xml

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 26, 2003 6:26 pm 
Pro
Pro

Joined: Wed Oct 08, 2003 10:31 am
Posts: 247
epbernard wrote:
hibernate.jdbc.batch_size=0 in your hibernate.cfg.xml


Thanks Emmanuel for the batch tip.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.