gavin wrote:
If that is what you want to do, use StatelessSession in HB 3.1.
Or, follow these instructions for HB 3.0:
http://www.hibernate.org/hib_docs/v3/re ... ch-inserts
Gavin,
I am new to hibernate as well. I did read the reference .pdf but I am getting some serious performance difference if I use JDBC straight with java assist based transforms and using Hibernate to populate the results.
I my own version of OR mapping tool (which is not as sophisticated as Hibernate but is fast) I create javassist transforms. So essentially I create a class which has code like this:
public void exportObject(PreparedStatement preparedStatement, Object o) {
statement.setString(1, dataObject.getFirstName());
statement.setString(1, dataObject.getMidName());
statement.setString(1, dataObject.getLastName());
statement.setInt(1, dataObject.getAcctNum());
// ... and so on
}
Using this approach I am getting nearly 4-5 times better performance while writing objects to a table. Is there something that I am missing in hibernate. I will keep scouring the forums but if you do know how to solve this please post.
I have already set the following in the cfg file:
<property name="hibernate.jdbc.batch_size">20</property>
<property name="hibernate.cache.use_second_level_cache">false</property>
Thanks,
kd