-->
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.  [ 1 post ] 
Author Message
 Post subject: Can't see change in database after delete
PostPosted: Tue Feb 01, 2005 11:46 am 
Beginner
Beginner

Joined: Thu Jan 22, 2004 6:16 am
Posts: 40
Location: Luxembourg
Even though the session deletes 4 objects, no changes are seen in the database after the commit. I have read the FAQ concerning this, and for me it seems like soing exactly as told.Ideas ?

[code]
for ( int i = 0; i < res.size ( ); i++ )
{
ChannelBean resobj = ( ChannelBean ) res.get ( i );
xstr = xstream.toXML ( resobj );

/* other code with no Hibernate involved */

Transaction trans = session.beginTransaction();
int j = session.delete("from " + arClass.getName() + " cls where cls.id = '" + resobj.getId() + "'");
System.err.println("DELETED : " + j);

trans.commit();
}
code]

And here are the logs :

[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.transaction.JDBCTransaction - begin
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.transaction.JDBCTransaction - current autocommit status:false
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - delete: bfo.BFO cls where cls.id = '00fca1be46b80050'
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - find: from bfo.BFO cls where cls.id = '00fca1be46b80050'
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.hql.QueryTranslator - compiling query
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.hql.QueryTranslator - HQL: from bfo.BFO cls where cls.id = '00fca1be46b80050'
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - about to open: 0 open PreparedStatements, 0 open ResultSets
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - preparing statement
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.loader.Loader - processing result set
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.type.StringType - returning '00fca1be46b80050' as column: id
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.loader.Loader - result row: 00fca1be46b80050
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.loader.Loader - done processing result set (1 rows)
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - done closing: 0 open PreparedStatements, 0 open ResultSets
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - closing statement
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.loader.Loader - total objects hydrated: 0
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - initializing non-lazy collections
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - deleting a persistent instance
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - deleting [bfo.BFO#00fca1be46b80050]
DELETED : 1
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.transaction.JDBCTransaction - commit
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - transaction completion
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.transaction.JDBCTransaction - begin
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.transaction.JDBCTransaction - current autocommit status:false
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - delete: bfo.BFO cls where cls.id = '00fb9b44b03f0185'
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - find: from bfo.BFO cls where cls.id = '00fb9b44b03f0185'
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.hql.QueryTranslator - compiling query
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.hql.QueryTranslator - HQL: from bfo.BFO cls where cls.id = '00fb9b44b03f0185'
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - about to open: 0 open PreparedStatements, 0 open ResultSets
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - preparing statement
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.loader.Loader - processing result set
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.type.StringType - returning '00fb9b44b03f0185' as column: id
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.loader.Loader - result row: 00fb9b44b03f0185
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.loader.Loader - done processing result set (1 rows)
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - done closing: 0 open PreparedStatements, 0 open ResultSets
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - closing statement
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.loader.Loader - total objects hydrated: 0
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - initializing non-lazy collections
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - deleting a persistent instance
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - deleting [bfo.BFO#00fb9b44b03f0185]
DELETED : 1
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.transaction.JDBCTransaction - commit
[01/02/05 16:25:11][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - transaction completion
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.transaction.JDBCTransaction - begin
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.transaction.JDBCTransaction - current autocommit status:false
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - delete: from bfo.BFO cls where cls.id = '00fcc0b803e70047'
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - find: from bfo.BFO cls where cls.id = '00fcc0b803e70047'
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.hql.QueryTranslator - compiling query
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.hql.QueryTranslator - HQL: from bfo.BFO cls where cls.id = '00fcc0b803e70047'
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - about to open: 0 open PreparedStatements, 0 open ResultSets
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - preparing statement
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.loader.Loader - processing result set
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.type.StringType - returning '00fcc0b803e70047' as column: id
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.loader.Loader - result row: 00fcc0b803e70047
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.loader.Loader - done processing result set (1 rows)
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - done closing: 0 open PreparedStatements, 0 open ResultSets
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - closing statement
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.loader.Loader - total objects hydrated: 0
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - initializing non-lazy collections
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - deleting a persistent instance
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - deleting [bfo.BFO#00fcc0b803e70047]
DELETED : 1
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.transaction.JDBCTransaction - commit
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - transaction completion
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.transaction.JDBCTransaction - begin
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.transaction.JDBCTransaction - current autocommit status:false
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - delete: from bfo.BFO cls where cls.id = '00fbe361e7f7025e'
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - find: from bfo.BFO cls where cls.id = '00fbe361e7f7025e'
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.hql.QueryTranslator - compiling query
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.hql.QueryTranslator - HQL: from bfo.BFO cls where cls.id = '00fbe361e7f7025e'
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - about to open: 0 open PreparedStatements, 0 open ResultSets
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - preparing statement
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.loader.Loader - processing result set
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.type.StringType - returning '00fbe361e7f7025e' as column: id
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.loader.Loader - result row: 00fbe361e7f7025e
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.loader.Loader - done processing result set (1 rows)
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - done closing: 0 open PreparedStatements, 0 open ResultSets
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.BatcherImpl - closing statement
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.loader.Loader - total objects hydrated: 0
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - initializing non-lazy collections
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - deleting a persistent instance
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - deleting [bfo.BFO#00fbe361e7f7025e]
DELETED : 1
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.transaction.JDBCTransaction - commit
[01/02/05 16:25:12][main ][DEBUG] net.sf.hibernate.impl.SessionImpl - transaction completion

Regards


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

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.