views:

54

answers:

1

can anyone explain on this 2 properties

Q1. hibernate.cglib.use_reflection_optimizer ? what is the effect of setting to true and false


Q2. hibernate.c3p0.max_statements . i read hibernate doc https://www.hibernate.org/214.html. it only mentioned default value is 0. I am using oracle10g, and i set to 100. but i want to know how to find out what is the max database can support? also dose this property mean max length of sql statement can support?

+1  A: 

A1. false will make Hibernate start faster since it does not try to build cglib-enhanced objects to access getter/setters, and use standard JDK reflection for access. It might have some negative impact on overall runtime performance, though. And the value true means just the opposite.

Refer to: https://www.hibernate.org/194.html

A2. It is the size of c3p0's PreparedStatement cache. Zero means statement caching is turned off.

As it seems from your comments, you are still not clear about the size of c3p0 for PreparedStatement. I think you should read on PreparedStatement, then you will be able to understand.

From the docs,

A SQL statement is precompiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.

So, that means it caches the PreparedStatement objects. Underlying database doesn't matter in this case.

Adeel Ansari
for A2, what is the max i can set? depend on database capability?
cometta
https://www.hibernate.org/194.html don't forget the link :)
Bozho
@cometta: No its not that. Its cache size for `PreparedStatement`. You need to understand `PreparedStatement`. BTW, c3p0 is a connection pool implementation, in case you are not aware of it.
Adeel Ansari
@Bozho: Added thanks.
Adeel Ansari