-->
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.  [ 1 post ] 
Author Message
 Post subject: Patterns of Hibernate usage that affect the performance
PostPosted: Thu Mar 04, 2010 9:14 am 
Newbie

Joined: Tue Feb 16, 2010 8:11 am
Posts: 4
Hello,

I'm working on a small research. I want to know if it is possible to find patterns of Hibernate usage in source code, that (can) affect the Hibernate performance (in a bad way), by static code analysis. If it is then, I want to know what these patterns are and how I can find them with static code analysis.

I'm planning to develop an open source tool that find some of these patterns, and warns/advises the developer. This tool can be very useful for developers that use Hibernate but are not really experienced.

Right now I'm searching for some patterns but that seemed harder than I thought. Some of the patterns I found are:
    1 A query executed in a loop.
    2 When you have an extraordinarily large number of columns (say: >50) in a table and the setting dynamic-update and dynamic-insert are not set true.
    3 Accessor methods of collection properties in a persistence class that don’t return or set the actual property (because, collections are compared by identity. In that case you avoid unnecessary updates). To clarify: you want to avoid, for example, the following code in a persistence class:
    Code:
    public void setNames(List namesList) {
        names = (String[]) namesList.toArray();
    }
    public List getNames() {
        return Arrays.asList(names);
    }


I hope that some of you can help me with finding some more patterns. Or give me some references where I can find some more patterns.

Thank you all very much in advance =)!

--Jasper


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

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.