Hi,
I am implementing call back methods from net.sf.hibernate.Lifecycle. But the insert query is not generated and sequence generation. Do i have to do something in onLoad() in the class which is implementing the Lifecycle interface.
THe stack trace which i get after implementing Lifecycle is :
6:42:23,823 DEBUG SessionImpl:413 - opened session
16:42:23,823 DEBUG JDBCTransaction:36 - begin
16:42:23,823 DEBUG DriverManagerConnectionProvider:77 - total checked-out connections: 0
16:42:23,823 DEBUG DriverManagerConnectionProvider:83 - using pooled JDBC connection, pool size: 0
16:42:23,823 DEBUG BatcherImpl:166 - about to open: 0 open PreparedStatements, 0 open ResultSets
16:42:23,823 DEBUG SessionFactoryImpl:526 - prepared statement get: select BGM_COMPONENTS.T_ROLE_SEQUENCE.nextval from dual
16:42:23,917 DEBUG SequenceGenerator:70 - Sequence identifier generated: 26
16:42:23,917 DEBUG BatcherImpl:173 - done closing: 0 open PreparedStatements, 0 open ResultSets
16:42:23,932 DEBUG SessionImpl:656 - saving [com.bunge.bgm.common.domain.user.Role#26]
id isss onsave ===> 26
16:42:23,932 DEBUG JDBCTransaction:54 - commit
16:42:23,932 DEBUG SessionImpl:2011 - flushing session
16:42:23,932 DEBUG SessionImpl:2113 - Flushing entities and processing referenced collections
16:42:23,932 DEBUG SessionImpl:2397 - Processing unreferenced collections
16:42:23,932 DEBUG SessionImpl:2408 - Scheduling collection removes/(re)creates/updates
16:42:23,932 DEBUG SessionImpl:2023 - Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
16:42:23,932 DEBUG SessionImpl:2028 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
16:42:23,932 DEBUG SessionImpl:2058 - executing flush
16:42:23,932 DEBUG SessionImpl:2428 - post flush
16:42:23,932 DEBUG SessionImpl:447 - transaction completion
16:42:23,932 DEBUG SessionImpl:435 - closing session
16:42:23,932 DEBUG SessionImpl:2930 - disconnecting session
16:42:23,932 DEBUG DriverManagerConnectionProvider:117 - returning connection to pool, pool size: 1
16:42:23,932 DEBUG SessionImpl:447 - transaction completion
While the stack trace after removing the Lifecycle interface from the class which implemented it is :
6:45:57,469 DEBUG SessionImpl:413 - opened session
16:45:57,485 DEBUG JDBCTransaction:36 - begin
16:45:57,485 DEBUG DriverManagerConnectionProvider:77 - total checked-out connections: 0
16:45:57,485 DEBUG DriverManagerConnectionProvider:83 - using pooled JDBC connection, pool size: 0
16:45:57,485 DEBUG BatcherImpl:166 - about to open: 0 open PreparedStatements, 0 open ResultSets
16:45:57,485 DEBUG SessionFactoryImpl:526 - prepared statement get: select BGM_COMPONENTS.T_ROLE_SEQUENCE.nextval from dual
16:45:57,672 DEBUG SequenceGenerator:70 - Sequence identifier generated: 27
16:45:57,672 DEBUG BatcherImpl:173 - done closing: 0 open PreparedStatements, 0 open ResultSets
16:45:57,672 DEBUG SessionImpl:656 - saving [com.bunge.bgm.common.domain.user.Role#27]
16:45:57,688 DEBUG JDBCTransaction:54 - commit
16:45:57,688 DEBUG SessionImpl:2011 - flushing session
16:45:57,688 DEBUG SessionImpl:2113 - Flushing entities and processing referenced collections
16:45:57,688 DEBUG SessionImpl:2397 - Processing unreferenced collections
16:45:57,703 DEBUG SessionImpl:2408 - Scheduling collection removes/(re)creates/updates
16:45:57,703 DEBUG SessionImpl:2023 - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
16:45:57,703 DEBUG SessionImpl:2028 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
16:45:57,703 DEBUG SessionImpl:2058 - executing flush
16:45:57,703 DEBUG EntityPersister:464 - Inserting entity: com.bunge.bgm.common.domain.user.Role#27
16:45:57,703 DEBUG BatcherImpl:166 - about to open: 0 open PreparedStatements, 0 open ResultSets
16:45:57,703 DEBUG SessionFactoryImpl:526 - prepared statement get: insert into BGM_COMPONENTS.T_ROLE (LONGNAME, SHORTNAME, ACTIVE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, ID) values (?, ?, ?, ?, ?, ?, ?, ?)
16:45:57,719 DEBUG EntityPersister:366 - Dehydrating entity: com.bunge.bgm.common.domain.user.Role#27
16:45:57,719 DEBUG BatcherImpl:173 - done closing: 0 open PreparedStatements, 0 open ResultSets
16:45:57,719 DEBUG SessionImpl:2428 - post flush
16:45:57,735 DEBUG SessionImpl:447 - transaction completion
16:45:57,735 DEBUG SessionImpl:435 - closing session
16:45:57,735 DEBUG SessionImpl:2930 - disconnecting session
16:45:57,750 DEBUG DriverManagerConnectionProvider:117 - returning connection to pool, pool size: 1
16:45:57,750 DEBUG SessionImpl:447 - transaction completion
Did anyone face this before ? May be i am missing something. Please help.
|