-->
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.  [ 2 posts ] 
Author Message
 Post subject: What performance can "immutable objects" bring?
PostPosted: Tue Sep 14, 2004 6:56 pm 
Beginner
Beginner

Joined: Thu Jul 01, 2004 1:30 pm
Posts: 20
Location: Tucson, AZ
Hibernate version: 2.1

Name and version of the database you are using:PostgreSQL

This is a general question. The Hibernate online reference doc says "Immutable classes, mutable="false", may not be updated or deleted by the application. This allows Hibernate to make some minor performance optimizations". I just wonder what optimization is implemented? And how much approximately improvement it can bring? Any figures or numbers to show the improvement?

In a simple testcase, where I create and persist an object, restart the session and then retrieved it, I did not see any difference in the SQL when using immutable and mutable objects. Could anyone kindly provide any elaboration on that?

Thanks,
Stan


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 14, 2004 6:58 pm 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
AFAIK - You won't find any differences in the generated SQL...

The difference can appear when you have a large amount of such entities in the Hibernate session. Because they are declared 'immutable', Hibernate won't inspect them at flush time to determine if it has something to commit to the database or not.


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