Hi All,
I am inserting a batch of records into the table. The first record is inserting properly and from the second record ..it is giving "ignoring persistent instance DEBUG - object already associated with session:"
Here i am giving the sample code what i have written.
session = getSession();
transaction = session.beginTransaction();
while (iterator.hasNext( )) {
abcVO = masterVO.getAbcVO();
session.save(abcVO);
if ( i % 20 == 0 ) { //20, same as the JDBC batch size
//flush a batch of inserts and release memory:
session.flush();
session.clear();
}
i = i + 1;
}
transaction.commit();
I have configured the hibernate.cfg.xml file as follows:
<property name="connection.username">username</property>
<property name="connection.url">jdbc:oracle:thin:@HostName:1521</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="connection.password">password</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.jdbc.batch_size">20</property>
<property name="hibernate.cache.use_second_level_cache">false</property>
Regards,
|