-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Creating with callback methods
PostPosted: Wed Oct 29, 2003 5:47 pm 
Beginner
Beginner

Joined: Wed Oct 22, 2003 11:26 am
Posts: 31
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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 29, 2003 5:53 pm 
Beginner
Beginner

Joined: Wed Oct 22, 2003 11:26 am
Posts: 31
i got the solution for the problem i posted....i was saying return true for onSave() which i replaced with return NO_VETO.
Please delete this thread.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.