File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Which tool to use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Which tool to use" Watch "Which tool to use" New topic
Author

Which tool to use

M Mehta
Ranch Hand

Joined: Aug 03, 2006
Posts: 92
Hi,

We are in the initial phase of creating a new java application. Confused on which tool to use for database interaction - Hibernate or iBatis. The application will be having some web services which will fetch data from a few huge databases and then after processing this data will return results.

I have seen a similar application working with a similar database using hibernate. Its deployed on WAS. The search queries usually fetch data with about 5000 or more rows. The queries often hang and time out. I have been asked to explore if using iBatis will increase the performance or not.

Thanks,
Me

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


The queries often hang and time out

If I were seeing queries hang I'd be checking the database first.

iBatis and Hibernate are both ORMs. If your performance problem is not the database but memory, then swapping ORMs is unlikely to help at all. I'd recommend working out what is causing your performance problem first.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
M Mehta
Ranch Hand

Joined: Aug 03, 2006
Posts: 92
Thanks Paul for the reply..

I have checked the query being generated by hibernate and tried to optimize it using SQL optimizer. But it seems that the query being generated is already the optimized one. The cause of low performance is that the tables being queried have huge amount of data and there are a lot of outer joins in the query which is due to functionality required. However, still the query takes lesser time when run directly on the database through sql developer.

To know the cause of more time taken through hibernate, I enabled the debug level for hibernate and found that while the query takes some time in running , more time goes in loading the value objects which mapped to the queried tables. So I am curious to know if using iBatis will improve the performance or not.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

If that's the problem then probably not. ORMs need to load data - they are not good choices for bulk operations, if that is what you are trying.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Which tool to use