-->
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.  [ 3 posts ] 
Author Message
 Post subject: why we use 'dynamic-insert'
PostPosted: Thu Apr 20, 2006 12:16 am 
Newbie

Joined: Tue Apr 18, 2006 10:56 am
Posts: 4
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Can Plz anybody explain what is use with 'dynamic-insert' in mapping File.
i tryed a lot get it.

_________________
Sreedhar P


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 20, 2006 1:04 am 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Without dynamic-insert, each class' insert SQL statement is generated when the mapping file is parsed. This is efficient, as all that work is done only once. However, every column is always inserted.
With dynamic-insert, the SQL is generated only when you're about to insert a row. The smallest possible insert statement is generated, omitting columns that aren't needed (null values, or values that are equal to the default). This takes longer on the java side, but can be slightly quicker on the DB side. Use this for tables with many columns, most of which are usually null, or use it if your DB server is much slower than the machine your JVM is on.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 22, 2006 2:37 am 
Newbie

Joined: Tue Apr 18, 2006 10:56 am
Posts: 4
tenwit wrote:
Without dynamic-insert, each class' insert SQL statement is generated when the mapping file is parsed. This is efficient, as all that work is done only once. However, every column is always inserted.
With dynamic-insert, the SQL is generated only when you're about to insert a row. The smallest possible insert statement is generated, omitting columns that aren't needed (null values, or values that are equal to the default). This takes longer on the java side, but can be slightly quicker on the DB side. Use this for tables with many columns, most of which are usually null, or use it if your DB server is much slower than the machine your JVM is on.


Hi.....tenwit



Thnx a lot for Quick Replay. Now I got how to use 'dynamic-insert', As Really i got a Table with around 20 columns , where 7 columns are stays with default values , now i can use this. once again .....thnx......
have a gr8 day
Sreedhar P

_________________
Sreedhar P


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.