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
|