Prepare Statement Caching

Description

We are using Hibernate 3.2.5 are trying to evaluate hibernate batching vis a vis JDBC batching.

As per our results the hibernate batching takes approx 2 times the time taken by JDBC batching.

The problem is we need to commit the batches also so in a loop we are commiting the transaction also (batching).
But for every new loop hibernate creates new prepared statements i.e. if we have 20 batches 20 prepared statements per table/entity are being created but in case of JDBC the same can be done using 1 prepared statement per table/entity.
Hibernate does reuse the prepared statements within a batch but not across batches. If hibernate can reuse these statements it would significantly reduce the timings and would bring the hibernate batching close to jdbc batching.

This is happening even after enabling prepare statement caching in the hibernate cfg xml.

Environment

Hibernate 3.2.5, Oracle 10g

Activity

Show:
Swagat Kumar Sahoo
December 8, 2009, 3:18 PM

This is an example of usage of the prepared statement. This test case may not work properly but gives an idea of how we use it. That means after commit, the PS is unusable. We have to manually reopen it. So, pls provide a way to reuse the same PS.

Brett Meyer
April 7, 2014, 5:45 PM

In an effort to clean up, in bulk, tickets that are most likely out of date, we're transitioning all ORM 3 tickets to an "Awaiting Test Case" state. Please see http://in.relation.to/Bloggers/HibernateORMJIRAPoliciesAndCleanUpTactics for more information.

If this is still a legitimate bug in ORM 4, please provide either a test case that reproduces it or enough detail (entities, mappings, snippets, etc.) to show that it still fails on 4. If nothing is received within 3 months or so, we'll be automatically closing them.

Thank you!

Brett Meyer
July 8, 2014, 3:11 PM

Bulk rejecting stale issues. If this is still a legitimate issue on ORM 4, feel free to comment and attach a test case. I'll address responses case-by-case. Thanks!

Rejected

Assignee

Unassigned

Reporter

lalit railwani

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major