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.
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.
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.