Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
2.1
Mapping documents:
Code between sessionFactory.openSession() and session.close():
AddRecord.java
---------------------------------------------------
....
for (int j = 0 ; j < rList.size() ; j++) {
Record r = (Record) rList.get(j) ;
session.save(r);
}
...
Record.java
--------------------------------------------------
....
public class Record implements Interceptor {
...
public boolean onSave(
Object entity,
Serializable id,
Object[] state,
String[] propertyNames,
Type[] types) throws CallbackException {
boolean result = false;
System.out.println(">>>>>>>>>>>>>>>onSave") ;
validateThis() ;
return result;
}
}
....
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
The problem is the record is getting SAVED in the database, but the onSave method defined in my persistent class above is not getting called. i also put debug/print statements in the other methods like onFlushDirty, preFlush, postFlush etc. none of them are getting called. BUT THE RECORD is SAVED in the database.
The Flush mode is AUTO and Dirty mode is false.
What am i missing?
when does the onSave get triggered? what can i do to make sure an onSave gets called when i invoke .save()?
thanks for your help.