-->
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: How to achieve Better performance
PostPosted: Mon Jun 19, 2006 3:23 pm 
Newbie

Joined: Mon Jun 19, 2006 1:47 pm
Posts: 2
What is better in terms of performance?

Using a tool like NHibernate?

Execute in-line SQL queries from inside a program and execute them thru ADO.NET?

Have Store Procedures and Views in the DB side and execute them thru ADO.NET from the program?


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 19, 2006 4:09 pm 
Newbie

Joined: Wed Mar 22, 2006 3:22 pm
Posts: 9
That is a pretty general question.

I think the fastest (in general) would be the stored procedures and views, then direct JDBC, the NHibernate. Some would argue that since Hibernate has first and second level caches that the performance is close if not better in some situation then executing direct SQL. I see it from more of a maintenance issue. I have executed query strings directly from within code and when table name and/or column names change it is aweful to go back through and do search and replace. Same with storing the SQL in a property file. Hibernate makes this easier with mapping files or annotations. Writing queries in much quicker once you learn HQL which is not hard. For instance I can;t imagine having to do lots of joins any more because Hibernate does it all for me. Building SQL dynamically form user input is a pain, but with Criteria queries it is so simple. I myself have not run into any performance problems wiht Hibernate. The one performance problem I did have and which typically presents itself in every project I have worked is setting the JDBC fetchsize in the Hibernate configuration file. You have to ask yourself this ... if you use store procedures and JDBC direct how will I be using the results? If the answer is converting everyhting in object before you use the result then why not have a ORM tool that doe sit for you and is easy to maintain.

Good luck


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.