-->
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: Hibernate Deleting Objects from Oracle DB failing
PostPosted: Tue Nov 30, 2004 9:07 am 
Newbie

Joined: Sun Jan 18, 2004 4:05 pm
Posts: 5
The problem rests in the fact that everything goes smoothly and the log looks great, like everythig is perfect and then I go to the DB and the records haven't been deleted, I don't care how stupid the error is, someone please point it out, as I am about to take my own life over this.

Hibernate version:
2.1.6
Mapping documents:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
<!-- Oracle Session Factory -->
<session-factory>

<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">1800</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.c3p0.acquire_increment">2</property>
<property name="hibernate.c3p0.validate">false</property>

<property name="hibernate.connection.url">xxxxx</property>
<property name="hibernate.connection.username">xxxxx</property>
<property name="hibernate.connection.password">xxxxx</property>

<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.pool_size">5</property>

<property name="dialect">net.sf.hibernate.dialect.OracleDialect</property>
<property name="hibernate.jdbc.batch_size">0</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.use_outer_join">true</property>
<property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">net.sf.hibernate.transaction.ResinTransactionManagerLookup</property>

<mapping resource="com/bayt/hibernate/mapping/BytIndexPending.hbm.xml"/>

<property name="jta.UserTransaction">java:comp/UserTransaction</property>
</session-factory>
</hibernate-configuration>

Code between sessionFactory.openSession() and session.close():

I hard coded an ID in for test purposes

try {
// Remove the documents that have been indexed
Transaction oraTx2 = oraS.beginTransaction();
int delCount2 = oraS.delete("select bip from com.bayt.hibernate.mapping.BytIndexPending bip where bip.Id in ( 170840 ) " ) ;
oraTx2.commit();
System.out.println("*** DONE CV DELETE COMMIT ("+delCount2+")" ) ;
} catch (HibernateException e) {
logger.error("HibernateException @ runCvIndex",e) ;
}

Full stack trace of any exception that occurs:

no errors, it just doesn't work

Name and version of the database you are using:
Oracle 8.1.6 using the classes12.zip driver (I used ojdbc14.jar and it didn't work either)
The generated SQL (show_sql=true):
the SQL is in the log
Debug level Hibernate log excerpt:

HQL: select bip from com.bayt.hibernate.mapping.BytIndexPending bip where bip.Id in ( 170840 )
SQL: select bytindexpe0_.XID as XID, bytindexpe0_.ENTRY_DATE as ENTRY_DATE, bytindexpe0_.ENTRY_TYPE as ENTRY_TYPE, bytindexpe0_.REQUEST_TYPE as REQUEST_4_, bytindexpe0_.IS_PROCESSED as IS_PROCE5_ from BYT_INDEX_PENDING bytindexpe0_ where (bytindexpe0_.XID in(170840))
about to open: 0 open PreparedStatements, 0 open ResultSets
select bytindexpe0_.XID as XID, bytindexpe0_.ENTRY_DATE as ENTRY_DATE, bytindexpe0_.ENTRY_TYPE as ENTRY_TYPE, bytindexpe0_.REQUEST_TYPE as REQUEST_4_, bytindexpe0_.IS_PROCESSED as IS_PROCE5_ from BYT_INDEX_PENDING bytindexpe0_ where (bytindexpe0_.XID in(170840))
preparing statement
processing result set
returning '170840' as column: XID
result row: 170840
Initializing object from ResultSet: 170840
Hydrating entity: com.bayt.hibernate.mapping.BytIndexPending#170840
net.sf.hibernate.type.TimestampType returning '2004-11-24 11:44:07' as column: ENTRY_DATE
returning 'CV' as column: ENTRY_TYPE
returning 'U' as column: REQUEST_4_
returning 'F' as column: IS_PROCE5_
done processing result set (1 rows)
done closing: 0 open PreparedStatements, 0 open ResultSets
closing statement
total objects hydrated: 1
resolving associations for [com.bayt.hibernate.mapping.BytIndexPending#170840]
done materializing entity [com.bayt.hibernate.mapping.BytIndexPending#170840]
initializing non-lazy collections
deleting a persistent instance
deleting [com.bayt.hibernate.mapping.BytIndexPending#170840]
commit
flushing session
Flushing entities and processing referenced collections
Processing unreferenced collections
Scheduling collection removes/(re)creates/updates
Flushed: 0 insertions, 0 updates, 1 deletions to 1 objects
Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
listing entities:
com.bayt.hibernate.mapping.BytIndexPending{EntryType=CV, IsProcessed=F, RequestType=U, EntryDate=2004-11-24 11:44:07, Id=170840}
executing flush
Deleting entity: [com.bayt.hibernate.mapping.BytIndexPending#170840]
about to open: 0 open PreparedStatements, 0 open ResultSets
delete from BYT_INDEX_PENDING where XID=?
preparing statement
binding '170840' to parameter: 1
done closing: 0 open PreparedStatements, 0 open ResultSets
closing statement
post flush
Committing UserTransaction started by Hibernate
transaction completion
closing session


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.