-->
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.  [ 8 posts ] 
Author Message
 Post subject: Delete fails when object is referenced directly and thru set
PostPosted: Mon Sep 22, 2003 8:41 pm 
Newbie

Joined: Sun Sep 21, 2003 7:36 pm
Posts: 3
I have two classes, TestSubscription and TestCharge. TestSubscription has a reference to the "active charge" and has a set of all charges for that subscription, which includes the active charge. When I try to remove the subscription, I get a db constraint error. It looks like Hibernate tries to delete the TestCharge before null'ing out the activeCharge reference in TestSubscription.

Note that if TestSubscription does not have a set of charges and just has the active charge, the delete works. Hibernate handles it correctly and nulls the activeCharge reference before removing the TestCharge. Any idea why adding the set makes it fail? Thanks,

Matt

TestCharge.hbm.xml
Code:
<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
    <class
        name="com.borderless.data.TestCharge"
        table="test_charge"
        dynamic-update="false"
        dynamic-insert="false"
    >

        <id
            name="id"
            column="id"
            type="java.lang.Long"
        >
            <generator class="sequence">
                <param name="sequence">charges_id_seq</param>
            </generator>
        </id>

        <many-to-one
            name="subscription"
            class="com.borderless.data.TestSubscription"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            column="subscription_id"
        />

        <!--
            To add non XDoclet property mappings, create a file named
                hibernate-properties-TestCharge.xml
            containing the additional properties and place it in your merge dir.
        -->

    </class>

</hibernate-mapping>


TestSubscription.hbm.xml
Code:
<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
    <class
        name="com.borderless.data.TestSubscription"
        table="test_subscription"
        dynamic-update="false"
        dynamic-insert="false"
    >

        <id
            name="id"
            column="id"
            type="java.lang.Long"
        >
            <generator class="sequence">
                <param name="sequence">subscriptions_id_seq</param>
            </generator>
        </id>

        <many-to-one
            name="activeCharge"
            class="com.borderless.data.TestCharge"
            cascade="all"
            outer-join="auto"
            update="true"
            insert="true"
            column="active_charge_entry_id"
        />

        <set
            name="chargeEntries"
            lazy="false"
            inverse="true"
            cascade="all"
            sort="unsorted"
        >

              <key
                  column="subscription_id"
              />

              <one-to-many
                  class="com.borderless.data.TestCharge"
              />
        </set>

        <!--
            To add non XDoclet property mappings, create a file named
                hibernate-properties-TestSubscription.xml
            containing the additional properties and place it in your merge dir.
        -->

    </class>

</hibernate-mapping>


Main method:
Code:
        session = factory.openSession();
        try {
            tx = session.beginTransaction();
           
            List l = session.find( "from TestSubscription s where id = " + id );
            subscription = (TestSubscription) l.get( 0 );

            tx = session.beginTransaction();
            session.delete( subscription );
            session.flush();
           
            tx.commit();
        }
        catch (HibernateException he) {
            if (tx!=null) tx.rollback();
            throw he;
        }
        finally {
            session.close();
        }


Code:
| 2003-09-22 20:20:30,350 | INFO  | net.sf.hibernate.cfg.Environment | main | Environment.<clinit>:401 |  |
    Hibernate 2.0.1
| 2003-09-22 20:20:30,370 | INFO  | net.sf.hibernate.cfg.Environment | main | Environment.<clinit>:430 |  |
    hibernate.properties not found
| 2003-09-22 20:20:30,380 | INFO  | net.sf.hibernate.cfg.Environment | main | Environment.<clinit>:450 |  |
    using CGLIB reflection optimizer
| 2003-09-22 20:20:30,380 | INFO  | net.sf.hibernate.cfg.Environment | main | Environment.<clinit>:460 |  |
    JVM proxy support: true
| 2003-09-22 20:20:30,410 | INFO  | net.sf.hibernate.cfg.Configuration | main | Configuration.addClass:283 |  |
    Mapping resource: com/borderless/data/TestSubscription.hbm.xml
| 2003-09-22 20:20:31,311 | DEBUG | net.sf.hibernate.util.DTDEntityResolver | main | DTDEntityResolver.resolveEntity:20 |  |
    trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
| 2003-09-22 20:20:31,321 | DEBUG | net.sf.hibernate.util.DTDEntityResolver | main | DTDEntityResolver.resolveEntity:29 |  |
    found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
| 2003-09-22 20:20:31,902 | INFO  | net.sf.hibernate.cfg.Binder | main | Binder.bindRootClass:176 |  |
    Mapping class: com.borderless.data.TestSubscription -> test_subscription
| 2003-09-22 20:20:32,142 | DEBUG | net.sf.hibernate.cfg.Binder | main | Binder.bindProperty:380 |  |
    Mapped property: id -> id, type: long
| 2003-09-22 20:20:32,202 | DEBUG | net.sf.hibernate.cfg.Binder | main | Binder.bindProperty:380 |  |
    Mapped property: activeCharge -> active_charge_entry_id, type: com.borderless.data.TestCharge
| 2003-09-22 20:20:32,262 | DEBUG | net.sf.hibernate.cfg.Binder | main | Binder.bindProperty:380 |  |
    Mapped property: chargeEntries, type: java.util.Set
| 2003-09-22 20:20:32,262 | INFO  | net.sf.hibernate.cfg.Configuration | main | Configuration.addClass:283 |  |
    Mapping resource: com/borderless/data/TestCharge.hbm.xml
| 2003-09-22 20:20:32,282 | DEBUG | net.sf.hibernate.util.DTDEntityResolver | main | DTDEntityResolver.resolveEntity:20 |  |
    trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
| 2003-09-22 20:20:32,292 | DEBUG | net.sf.hibernate.util.DTDEntityResolver | main | DTDEntityResolver.resolveEntity:29 |  |
    found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
| 2003-09-22 20:20:32,403 | INFO  | net.sf.hibernate.cfg.Binder | main | Binder.bindRootClass:176 |  |
    Mapping class: com.borderless.data.TestCharge -> test_charge
| 2003-09-22 20:20:32,403 | DEBUG | net.sf.hibernate.cfg.Binder | main | Binder.bindProperty:380 |  |
    Mapped property: id -> id, type: long
| 2003-09-22 20:20:32,403 | DEBUG | net.sf.hibernate.cfg.Binder | main | Binder.bindProperty:380 |  |
    Mapped property: subscription -> subscription_id, type: com.borderless.data.TestSubscription
| 2003-09-22 20:20:32,413 | DEBUG | net.sf.hibernate.cfg.Binder | main | Binder$SecondPass.doSecondPass:1115 |  |
    Second pass for collection: com.borderless.data.TestSubscription.chargeEntries
| 2003-09-22 20:20:32,413 | INFO  | net.sf.hibernate.cfg.Binder | main | Binder.bindCollectionSecondPass:1006 |  |
    Mapping collection: com.borderless.data.TestSubscription.chargeEntries -> test_charge
| 2003-09-22 20:20:32,413 | DEBUG | net.sf.hibernate.cfg.Binder | main | Binder$SecondPass.doSecondPass:1127 |  |
    Mapped collection key: subscription_id, one-to-many: com.borderless.data.TestCharge
| 2003-09-22 20:20:32,863 | INFO  | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.<init>:140 |  |
    building session factory
| 2003-09-22 20:20:32,863 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.<init>:142 |  |
    instantiating session factory with properties: {java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.connection.password=, sun.boot.library.path=C:\j2sdk1.4.1\jre\bin, java.vm.version=1.4.1-b21, hibernate.connection.username=postgres, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=Service Pack 2, java.vm.specification.name=Java Virtual Machine Specification, user.dir=c:\devtools\EclipseWorkspace\msi1, java.runtime.version=1.4.1-b21, hibernate.connection.database=msi1-matt, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\j2sdk1.4.1\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\doo\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows 2000, sun.java2d.fontpath=, java.library.path=C:\j2sdk1.4.1\bin;.;C:\WINNT\System32;C:\WINNT;C:\WINNT\System32;c:\devtools\ruby\bin;C:\Program Files\Microsoft.Net\FrameworkSDK\Bin\;C:\WINNT\Microsoft.NET\Framework\v1.0.2204\;C:\WINNT\system32;C:\WINNT;C:\WINNT\system32\WBEM;c:\devtools\ant\bin;c:\Program Files\wincvs;;C:\Program Files\cvsnt;C:\cygwin\bin;C:\Applications\mas1.6.5\bin;;C:\Applications\mas1.6.5\bin , java.specification.name=Java Platform API Specification, java.class.version=48.0, hibernate.transaction.factory_class=net.sf.hibernate.transaction.JDBCTransactionFactory, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, os.version=5.0, user.home=C:\Documents and Settings\doo, user.timezone=America/New_York, java.awt.printerjob=sun.awt.windows.WPrinterJob, java.specification.version=1.4, file.encoding=Cp1252, hibernate.connection.driver_class=org.postgresql.Driver, java.class.path=c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\classes;c:\devtools\EclipseWorkspace\msi1\lib\httpunit.jar;
c:\devtools\EclipseWorkspace\msi1\lib\js.jar;c:\devtools\EclipseWorkspace\msi1\lib\junit.jar;
c:\devtools\EclipseWorkspace\msi1\lib\mockobjects-core-0.09.jar;c:\devtools\EclipseWorkspace\msi1\lib\servlet.jar;
c:\devtools\EclipseWorkspace\msi1\lib\Tidy.jar;c:\devtools\EclipseWorkspace\msi1\lib\xerces.jar;
c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\activation.jar;c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\axis.jar;
c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\cglib-asm.jar;c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\commons-beanutils.jar;
c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\commons-collections.jar;c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\commons-dbcp.jar;
c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\commons-digester.jar;c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\commons-discovery.jar;
c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\commons-fileupload.jar;c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\commons-lang.jar;
c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\commons-logging.jar;c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\commons-pool.jar;
c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\commons-resources.jar;c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\commons-services.jar;
c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\commons-validator.jar;c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\dom4j.jar;
c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\hibernate2.jar;c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\jakarta-ojb-0.9.8.jar;
c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\jakarta-oro.jar;c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\jaxrpc.jar;
c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\jdbc-se2.0.jar;c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\jta1.0.1.jar;
c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\mail.jar;c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\pg73jdbc3.jar;
c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\saaj.jar;c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\struts.jar;
c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\log4j.jar;c:\devtools\EclipseWorkspace\msi1\lib\xdoclet-1.2b4.jar;
c:\devtools\EclipseWorkspace\msi1\lib\xdoclet-hibernate-module-1.2b4.jar;c:\devtools\EclipseWorkspace\msi1\lib\xdoclet-xdoclet-module-1.2b4.jar;
c:\devtools\EclipseWorkspace\msi1\lib\xjavadoc-1.0.jar;c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\odmg.jar;
c:\devtools\EclipseWorkspace\msi1\docroot\WEB-INF\lib\persistence.jar;c:\devtools\EclipseWorkspace\msi1\lib\Verisign.jar, user.name=doo, hibernate.show_sql=false, java.vm.specification.version=1.0, sun.arch.data.model=32, java.home=C:\j2sdk1.4.1\jre, hibernate.dialect=net.sf.hibernate.dialect.PostgreSQLDialect, hibernate.connection.url=jdbc:postgresql://smith:5432/msi1-matt, java.specification.vendor=Sun Microsystems Inc., user.language=en, awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode, hibernate.cglib.use_reflection_optimizer=true, java.version=1.4.1, java.ext.dirs=C:\j2sdk1.4.1\jre\lib\ext, sun.boot.class.path=C:\j2sdk1.4.1\jre\lib\rt.jar;C:\j2sdk1.4.1\jre\lib\i18n.jar;C:\j2sdk1.4.1\jre\lib\sunrsasign.jar;C:\j2sdk1.4.1\jre\lib\jsse.jar;C:\j2sdk1.4.1\jre\lib\jce.jar;C:\j2sdk1.4.1\jre\lib\charsets.jar;C:\j2sdk1.4.1\jre\classes, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.cpu.endian=little, sun.io.unicode.encoding=UnicodeLittle, hibernate.use_outer_join=true, sun.cpu.isalist=pentium i486 i386}
| 2003-09-22 20:20:32,893 | INFO  | net.sf.hibernate.dialect.Dialect | main | Dialect.<init>:37 |  |
    Using dialect: net.sf.hibernate.dialect.PostgreSQLDialect
| 2003-09-22 20:20:32,933 | INFO  | net.sf.hibernate.connection.DriverManagerConnectionProvider | main | DriverManagerConnectionProvider.configure:41 |  |
    Hibernate connection pool size: 20
| 2003-09-22 20:20:32,953 | INFO  | net.sf.hibernate.connection.DriverManagerConnectionProvider | main | DriverManagerConnectionProvider.configure:70 |  |
    using driver: org.postgresql.Driver at URL: jdbc:postgresql://smith:5432/msi1-matt
| 2003-09-22 20:20:32,953 | INFO  | net.sf.hibernate.connection.DriverManagerConnectionProvider | main | DriverManagerConnectionProvider.configure:71 |  |
    connection properties: {user=postgres, password=, database=msi1-matt}
| 2003-09-22 20:20:32,963 | INFO  | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.<init>:170 |  |
    Use outer join fetching: true
| 2003-09-22 20:20:32,963 | DEBUG | net.sf.hibernate.connection.DriverManagerConnectionProvider | main | DriverManagerConnectionProvider.getConnection:77 |  |
    total checked-out connections: 0
| 2003-09-22 20:20:32,963 | DEBUG | net.sf.hibernate.connection.DriverManagerConnectionProvider | main | DriverManagerConnectionProvider.getConnection:90 |  |
    opening new JDBC connection
| 2003-09-22 20:20:33,264 | DEBUG | net.sf.hibernate.connection.DriverManagerConnectionProvider | main | DriverManagerConnectionProvider.getConnection:103 |  |
    created connection to: jdbc:postgresql://smith:5432/msi1-matt, Isolation Level: 2
| 2003-09-22 20:20:33,304 | DEBUG | net.sf.hibernate.connection.DriverManagerConnectionProvider | main | DriverManagerConnectionProvider.closeConnection:117 |  |
    returning connection to pool, pool size: 1
| 2003-09-22 20:20:33,304 | INFO  | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.<init>:193 |  |
    Use scrollable result sets: true
| 2003-09-22 20:20:33,304 | INFO  | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.<init>:194 |  |
    JDBC 2 max batch size: 15
| 2003-09-22 20:20:33,304 | INFO  | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.buildTransactionFactory:481 |  |
    Transaction strategy: net.sf.hibernate.transaction.JDBCTransactionFactory
| 2003-09-22 20:20:33,504 | INFO  | net.sf.hibernate.util.ReflectHelper | main | ReflectHelper.getMetaClass:321 |  |
    reflection optimizer disabled for: com.borderless.data.TestSubscription, IllegalArgumentException: setChargeEntries
| 2003-09-22 20:20:34,095 | DEBUG | net.sf.hibernate.impl.SessionFactoryObjectFactory | main | SessionFactoryObjectFactory.<clinit>:39 |  |
    initializing class SessionFactoryObjectFactory
| 2003-09-22 20:20:34,105 | DEBUG | net.sf.hibernate.impl.SessionFactoryObjectFactory | main | SessionFactoryObjectFactory.addInstance:76 |  |
    registered: 40288082nullf7cbd196null00f7nullcbd19cafnull0000 (unnamed)
| 2003-09-22 20:20:34,115 | INFO  | net.sf.hibernate.impl.SessionFactoryObjectFactory | main | SessionFactoryObjectFactory.addInstance:82 |  |
    no JDNI name configured
| 2003-09-22 20:20:34,115 | INFO  | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.<init>:287 |  |
    Query language substitutions: {}
| 2003-09-22 20:20:34,135 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.<init>:302 |  |
    instantiated session factory
| 2003-09-22 20:20:34,265 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.<init>:428 |  |
    opened session
| 2003-09-22 20:20:34,285 | DEBUG | net.sf.hibernate.transaction.JDBCTransaction | main | JDBCTransaction.begin:36 |  |
    begin
| 2003-09-22 20:20:34,285 | DEBUG | net.sf.hibernate.connection.DriverManagerConnectionProvider | main | DriverManagerConnectionProvider.getConnection:77 |  |
    total checked-out connections: 0
| 2003-09-22 20:20:34,285 | DEBUG | net.sf.hibernate.connection.DriverManagerConnectionProvider | main | DriverManagerConnectionProvider.getConnection:83 |  |
    using pooled JDBC connection, pool size: 0
| 2003-09-22 20:20:34,295 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logOpenPreparedStatement:157 |  |
    about to open: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:34,295 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:547 |  |
    prepared statement get: select nextval ('subscriptions_id_seq')
| 2003-09-22 20:20:34,295 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:557 |  |
    preparing statement
| 2003-09-22 20:20:34,345 | DEBUG | net.sf.hibernate.id.SequenceGenerator | main | SequenceGenerator.generate:70 |  |
    Sequence identifier generated: 1
| 2003-09-22 20:20:34,345 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logClosePreparedStatement:164 |  |
    done closing: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:34,345 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.closePreparedStatement:575 |  |
    closing statement
| 2003-09-22 20:20:34,355 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.doSave:671 |  |
    saving [com.borderless.data.TestSubscription#1]
| 2003-09-22 20:20:34,355 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades.cascade:301 |  |
    processing cascades for: com.borderless.data.TestSubscription
| 2003-09-22 20:20:34,365 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades$3.cascade:80 |  |
    cascading to saveOrUpdate()
| 2003-09-22 20:20:34,365 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades$10.isUnsaved:219 |  |
    unsaved-value strategy NULL
| 2003-09-22 20:20:34,375 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.saveOrUpdate:1213 |  |
    saveOrUpdate() unsaved instance with id: null
| 2003-09-22 20:20:34,375 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logOpenPreparedStatement:157 |  |
    about to open: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:34,375 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:547 |  |
    prepared statement get: select nextval ('charges_id_seq')
| 2003-09-22 20:20:34,375 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:557 |  |
    preparing statement
| 2003-09-22 20:20:34,415 | DEBUG | net.sf.hibernate.id.SequenceGenerator | main | SequenceGenerator.generate:70 |  |
    Sequence identifier generated: 1
| 2003-09-22 20:20:34,415 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logClosePreparedStatement:164 |  |
    done closing: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:34,425 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.closePreparedStatement:575 |  |
    closing statement
| 2003-09-22 20:20:34,425 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.doSave:671 |  |
    saving [com.borderless.data.TestCharge#1]
| 2003-09-22 20:20:34,435 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades.cascade:308 |  |
    done processing cascades for: com.borderless.data.TestSubscription
| 2003-09-22 20:20:34,445 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades.cascade:301 |  |
    processing cascades for: com.borderless.data.TestSubscription
| 2003-09-22 20:20:34,445 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades.cascade:308 |  |
    done processing cascades for: com.borderless.data.TestSubscription
| 2003-09-22 20:20:34,445 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEverything:2023 |  |
    flushing session
| 2003-09-22 20:20:34,455 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades.cascade:301 |  |
    processing cascades for: com.borderless.data.TestSubscription
| 2003-09-22 20:20:34,455 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades$3.cascade:80 |  |
    cascading to saveOrUpdate()
| 2003-09-22 20:20:34,465 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.saveOrUpdate:1195 |  |
    saveOrUpdate() persistent instance
| 2003-09-22 20:20:34,465 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades.cascade:308 |  |
    done processing cascades for: com.borderless.data.TestSubscription
| 2003-09-22 20:20:34,465 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEntities:2114 |  |
    Flushing entities and processing referenced collections
| 2003-09-22 20:20:34,486 | DEBUG | net.sf.hibernate.persister.AbstractEntityPersister | main | AbstractEntityPersister.findDirty:212 |  |
    com.borderless.data.TestCharge.subscription is dirty
| 2003-09-22 20:20:34,486 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEntities:2202 |  |
    Updating entity: [com.borderless.data.TestCharge#1]
| 2003-09-22 20:20:34,496 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushCollections:2373 |  |
    Processing unreferenced collections
| 2003-09-22 20:20:34,496 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushCollections:2384 |  |
    Scheduling collection removes/(re)creates/updates
| 2003-09-22 20:20:34,556 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEverything:2035 |  |
    Flushed: 2 insertions, 1 updates, 0 deletions to 2 objects
| 2003-09-22 20:20:34,556 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEverything:2040 |  |
    Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
| 2003-09-22 20:20:34,556 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.execute:2070 |  |
    executing flush
| 2003-09-22 20:20:34,566 | DEBUG | net.sf.hibernate.persister.EntityPersister | main | EntityPersister.insert:460 |  |
    Inserting entity: com.borderless.data.TestCharge#1
| 2003-09-22 20:20:34,576 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logOpenPreparedStatement:157 |  |
    about to open: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:34,576 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:547 |  |
    prepared statement get: insert into test_charge (subscription_id, id) values (?, ?)
| 2003-09-22 20:20:34,576 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:557 |  |
    preparing statement
| 2003-09-22 20:20:34,586 | DEBUG | net.sf.hibernate.persister.EntityPersister | main | EntityPersister.dehydrate:362 |  |
    Dehydrating entity: com.borderless.data.TestCharge#1
| 2003-09-22 20:20:34,586 | DEBUG | net.sf.hibernate.type.LongType | main | NullableType.nullSafeSet:38 |  |
    binding null to parameter: 1
| 2003-09-22 20:20:34,586 | DEBUG | net.sf.hibernate.type.LongType | main | NullableType.nullSafeSet:44 |  |
    binding '1' to parameter: 2
| 2003-09-22 20:20:34,596 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatchingBatcher.addToBatch:24 |  |
    Adding to batch
| 2003-09-22 20:20:34,596 | DEBUG | net.sf.hibernate.persister.EntityPersister | main | EntityPersister.insert:460 |  |
    Inserting entity: com.borderless.data.TestSubscription#1
| 2003-09-22 20:20:34,596 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatchingBatcher.doExecuteBatch:46 |  |
    Executing batch size: 1
| 2003-09-22 20:20:34,606 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logClosePreparedStatement:164 |  |
    done closing: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:34,606 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.closePreparedStatement:575 |  |
    closing statement
| 2003-09-22 20:20:34,606 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logOpenPreparedStatement:157 |  |
    about to open: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:34,606 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:547 |  |
    prepared statement get: insert into test_subscription (active_charge_entry_id, id) values (?, ?)
| 2003-09-22 20:20:34,606 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:557 |  |
    preparing statement
| 2003-09-22 20:20:34,616 | DEBUG | net.sf.hibernate.persister.EntityPersister | main | EntityPersister.dehydrate:362 |  |
    Dehydrating entity: com.borderless.data.TestSubscription#1
| 2003-09-22 20:20:34,616 | DEBUG | net.sf.hibernate.type.LongType | main | NullableType.nullSafeSet:44 |  |
    binding '1' to parameter: 1
| 2003-09-22 20:20:34,616 | DEBUG | net.sf.hibernate.type.LongType | main | NullableType.nullSafeSet:44 |  |
    binding '1' to parameter: 2
| 2003-09-22 20:20:34,616 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatchingBatcher.addToBatch:24 |  |
    Adding to batch
| 2003-09-22 20:20:34,616 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatchingBatcher.doExecuteBatch:46 |  |
    Executing batch size: 1
| 2003-09-22 20:20:34,676 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logClosePreparedStatement:164 |  |
    done closing: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:34,676 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.closePreparedStatement:575 |  |
    closing statement
| 2003-09-22 20:20:34,686 | DEBUG | net.sf.hibernate.persister.EntityPersister | main | EntityPersister.update:608 |  |
    Updating entity: com.borderless.data.TestCharge#1
| 2003-09-22 20:20:34,686 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logOpenPreparedStatement:157 |  |
    about to open: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:34,686 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:547 |  |
    prepared statement get: update test_charge set subscription_id=? where id=?
| 2003-09-22 20:20:34,696 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:557 |  |
    preparing statement
| 2003-09-22 20:20:34,696 | DEBUG | net.sf.hibernate.persister.EntityPersister | main | EntityPersister.dehydrate:362 |  |
    Dehydrating entity: com.borderless.data.TestCharge#1
| 2003-09-22 20:20:34,696 | DEBUG | net.sf.hibernate.type.LongType | main | NullableType.nullSafeSet:44 |  |
    binding '1' to parameter: 1
| 2003-09-22 20:20:34,696 | DEBUG | net.sf.hibernate.type.LongType | main | NullableType.nullSafeSet:44 |  |
    binding '1' to parameter: 2
| 2003-09-22 20:20:34,696 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatchingBatcher.addToBatch:24 |  |
    Adding to batch
| 2003-09-22 20:20:34,706 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatchingBatcher.doExecuteBatch:46 |  |
    Executing batch size: 1
| 2003-09-22 20:20:34,706 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logClosePreparedStatement:164 |  |
    done closing: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:34,706 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.closePreparedStatement:575 |  |
    closing statement
| 2003-09-22 20:20:34,706 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.postFlush:2404 |  |
    post flush
| 2003-09-22 20:20:34,716 | DEBUG | net.sf.hibernate.transaction.JDBCTransaction | main | JDBCTransaction.commit:54 |  |
    commit
| 2003-09-22 20:20:34,716 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEverything:2023 |  |
    flushing session
| 2003-09-22 20:20:34,716 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades.cascade:301 |  |
    processing cascades for: com.borderless.data.TestSubscription
| 2003-09-22 20:20:34,716 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades$3.cascade:80 |  |
    cascading to saveOrUpdate()
| 2003-09-22 20:20:34,726 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.saveOrUpdate:1195 |  |
    saveOrUpdate() persistent instance
| 2003-09-22 20:20:34,726 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades.cascade:308 |  |
    done processing cascades for: com.borderless.data.TestSubscription
| 2003-09-22 20:20:34,726 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEntities:2114 |  |
    Flushing entities and processing referenced collections
| 2003-09-22 20:20:34,726 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushCollections:2373 |  |
    Processing unreferenced collections
| 2003-09-22 20:20:34,736 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushCollections:2384 |  |
    Scheduling collection removes/(re)creates/updates
| 2003-09-22 20:20:34,736 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEverything:2035 |  |
    Flushed: 0 insertions, 0 updates, 0 deletions to 2 objects
| 2003-09-22 20:20:34,736 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEverything:2040 |  |
    Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
| 2003-09-22 20:20:34,736 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.execute:2070 |  |
    executing flush
| 2003-09-22 20:20:34,746 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.postFlush:2404 |  |
    post flush
| 2003-09-22 20:20:34,756 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.afterTransactionCompletion:462 |  |
    transaction completion
| 2003-09-22 20:20:34,756 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.close:450 |  |
    closing session
| 2003-09-22 20:20:34,756 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.disconnect:2877 |  |
    disconnecting session
| 2003-09-22 20:20:34,766 | DEBUG | net.sf.hibernate.connection.DriverManagerConnectionProvider | main | DriverManagerConnectionProvider.closeConnection:117 |  |
    returning connection to pool, pool size: 1
| 2003-09-22 20:20:34,766 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.afterTransactionCompletion:462 |  |
    transaction completion
| 2003-09-22 20:20:34,766 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.<init>:428 |  |
    opened session
| 2003-09-22 20:20:34,766 | DEBUG | net.sf.hibernate.transaction.JDBCTransaction | main | JDBCTransaction.begin:36 |  |
    begin
| 2003-09-22 20:20:34,776 | DEBUG | net.sf.hibernate.connection.DriverManagerConnectionProvider | main | DriverManagerConnectionProvider.getConnection:77 |  |
    total checked-out connections: 0
| 2003-09-22 20:20:34,836 | DEBUG | net.sf.hibernate.connection.DriverManagerConnectionProvider | main | DriverManagerConnectionProvider.getConnection:83 |  |
    using pooled JDBC connection, pool size: 0
| 2003-09-22 20:20:34,836 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.find:1341 |  |
    find: from TestSubscription s where id = 1
| 2003-09-22 20:20:34,876 | DEBUG | net.sf.hibernate.impl.SessionImpl | Finalizer | SessionImpl.finalize:2928 |  |
    running Session.finalize()
| 2003-09-22 20:20:34,886 | DEBUG | net.sf.hibernate.hql.QueryTranslator | main | QueryTranslator.compile:143 |  |
    compiling query
| 2003-09-22 20:20:34,956 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEverything:2023 |  |
    flushing session
| 2003-09-22 20:20:34,956 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEntities:2114 |  |
    Flushing entities and processing referenced collections
| 2003-09-22 20:20:34,956 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushCollections:2373 |  |
    Processing unreferenced collections
| 2003-09-22 20:20:34,956 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushCollections:2384 |  |
    Scheduling collection removes/(re)creates/updates
| 2003-09-22 20:20:34,956 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEverything:2035 |  |
    Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
| 2003-09-22 20:20:34,966 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEverything:2040 |  |
    Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
| 2003-09-22 20:20:34,966 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.autoFlushIfRequired:1586 |  |
    Dont need to execute flush
| 2003-09-22 20:20:34,966 | DEBUG | net.sf.hibernate.hql.QueryTranslator | main | QueryTranslator.logQuery:199 |  |
    HQL: from com.borderless.data.TestSubscription s where id = 1
| 2003-09-22 20:20:34,976 | DEBUG | net.sf.hibernate.hql.QueryTranslator | main | QueryTranslator.logQuery:200 |  |
    SQL: select testsubs0_.id as id, testsubs0_.active_charge_entry_id as active_c2_ from test_subscription testsubs0_ where (id=1 )
| 2003-09-22 20:20:34,976 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logOpenPreparedStatement:157 |  |
    about to open: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:34,976 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:547 |  |
    prepared statement get: select testsubs0_.id as id, testsubs0_.active_charge_entry_id as active_c2_ from test_subscription testsubs0_ where (id=1 )
| 2003-09-22 20:20:34,976 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:557 |  |
    preparing statement
| 2003-09-22 20:20:34,986 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.doFind:148 |  |
    processing result set
| 2003-09-22 20:20:34,986 | DEBUG | net.sf.hibernate.type.LongType | main | NullableType.nullSafeGet:65 |  |
    returning '1' as column: id
| 2003-09-22 20:20:34,986 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.getRow:260 |  |
    result row: 1
| 2003-09-22 20:20:34,996 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.loadFromResultSet:357 |  |
    Initializing object from ResultSet: 1
| 2003-09-22 20:20:34,996 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.hydrate:413 |  |
    Hydrating entity: com.borderless.data.TestSubscription#1
| 2003-09-22 20:20:34,996 | DEBUG | net.sf.hibernate.type.LongType | main | NullableType.nullSafeGet:65 |  |
    returning '1' as column: active_c2_
| 2003-09-22 20:20:34,996 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.doFind:182 |  |
    done processing result set (1 rows)
| 2003-09-22 20:20:35,006 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logClosePreparedStatement:164 |  |
    done closing: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:35,006 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.closePreparedStatement:575 |  |
    closing statement
| 2003-09-22 20:20:35,006 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.doFind:195 |  |
    total objects hydrated: 1
| 2003-09-22 20:20:35,006 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.initializeEntity:1966 |  |
    resolving associations for [com.borderless.data.TestSubscription#1]
| 2003-09-22 20:20:35,006 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.doLoadByClass:1764 |  |
    loading [com.borderless.data.TestCharge#1]
| 2003-09-22 20:20:35,016 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.doLoad:1855 |  |
    attempting to resolve [com.borderless.data.TestCharge#1]
| 2003-09-22 20:20:35,016 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.doLoad:1899 |  |
    object not resolved in any cache [com.borderless.data.TestCharge#1]
| 2003-09-22 20:20:35,026 | DEBUG | net.sf.hibernate.persister.EntityPersister | main | EntityPersister.load:390 |  |
    Materializing entity: com.borderless.data.TestCharge#1
| 2003-09-22 20:20:35,026 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logOpenPreparedStatement:157 |  |
    about to open: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:35,026 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:547 |  |
    prepared statement get: select testsubs1_.id as id0_, testsubs1_.active_charge_entry_id as active_c2_0_, testchar0_.id as id1_, testchar0_.subscription_id as subscrip2_1_ from test_charge testchar0_ left outer join test_subscription testsubs1_ on testchar0_.subscription_id=testsubs1_.id where testchar0_.id=?
| 2003-09-22 20:20:35,026 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:557 |  |
    preparing statement
| 2003-09-22 20:20:35,036 | DEBUG | net.sf.hibernate.type.LongType | main | NullableType.nullSafeSet:44 |  |
    binding '1' to parameter: 1
| 2003-09-22 20:20:35,036 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.doFind:148 |  |
    processing result set
| 2003-09-22 20:20:35,096 | DEBUG | net.sf.hibernate.type.LongType | main | NullableType.nullSafeGet:65 |  |
    returning '1' as column: id0_
| 2003-09-22 20:20:35,106 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.getRow:260 |  |
    result row: 1, 1
| 2003-09-22 20:20:35,106 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.loadFromResultSet:357 |  |
    Initializing object from ResultSet: 1
| 2003-09-22 20:20:35,106 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.hydrate:413 |  |
    Hydrating entity: com.borderless.data.TestCharge#1
| 2003-09-22 20:20:35,106 | DEBUG | net.sf.hibernate.type.LongType | main | NullableType.nullSafeGet:65 |  |
    returning '1' as column: subscrip2_1_
| 2003-09-22 20:20:35,106 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.doFind:182 |  |
    done processing result set (1 rows)
| 2003-09-22 20:20:35,116 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logClosePreparedStatement:164 |  |
    done closing: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:35,126 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.closePreparedStatement:575 |  |
    closing statement
| 2003-09-22 20:20:35,126 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.doFind:195 |  |
    total objects hydrated: 1
| 2003-09-22 20:20:35,126 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.initializeEntity:1966 |  |
    resolving associations for [com.borderless.data.TestCharge#1]
| 2003-09-22 20:20:35,126 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.doLoadByClass:1764 |  |
    loading [com.borderless.data.TestSubscription#1]
| 2003-09-22 20:20:35,136 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.doLoad:1855 |  |
    attempting to resolve [com.borderless.data.TestSubscription#1]
| 2003-09-22 20:20:35,136 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.doLoad:1870 |  |
    resolved object in session cache [com.borderless.data.TestSubscription#1]
| 2003-09-22 20:20:35,136 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.initializeEntity:1987 |  |
    done materializing entity [com.borderless.data.TestCharge#1]
| 2003-09-22 20:20:35,156 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.initialize:2835 |  |
    initializing collection [com.borderless.data.TestSubscription.chargeEntries#1]
| 2003-09-22 20:20:35,156 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logOpenPreparedStatement:157 |  |
    about to open: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:35,166 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:547 |  |
    prepared statement get: select test_cha0_.id as id__, test_cha0_.id as id, test_cha0_.subscription_id as subscrip2_ from test_charge test_cha0_ where test_cha0_.subscription_id=?
| 2003-09-22 20:20:35,166 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:557 |  |
    preparing statement
| 2003-09-22 20:20:35,177 | DEBUG | net.sf.hibernate.type.LongType | main | NullableType.nullSafeSet:44 |  |
    binding '1' to parameter: 1
| 2003-09-22 20:20:35,177 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.doFind:148 |  |
    processing result set
| 2003-09-22 20:20:35,177 | DEBUG | net.sf.hibernate.type.LongType | main | NullableType.nullSafeGet:65 |  |
    returning '1' as column: id
| 2003-09-22 20:20:35,187 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.getRow:260 |  |
    result row: 1
| 2003-09-22 20:20:35,187 | DEBUG | net.sf.hibernate.type.LongType | main | NullableType.nullSafeGet:65 |  |
    returning '1' as column: id__
| 2003-09-22 20:20:35,187 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.doLoadByClass:1764 |  |
    loading [com.borderless.data.TestCharge#1]
| 2003-09-22 20:20:35,187 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.doLoad:1855 |  |
    attempting to resolve [com.borderless.data.TestCharge#1]
| 2003-09-22 20:20:35,187 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.doLoad:1870 |  |
    resolved object in session cache [com.borderless.data.TestCharge#1]
| 2003-09-22 20:20:35,197 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.doFind:182 |  |
    done processing result set (1 rows)
| 2003-09-22 20:20:35,197 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logClosePreparedStatement:164 |  |
    done closing: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:35,257 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.closePreparedStatement:575 |  |
    closing statement
| 2003-09-22 20:20:35,257 | DEBUG | net.sf.hibernate.loader.Loader | main | Loader.doFind:195 |  |
    total objects hydrated: 0
| 2003-09-22 20:20:35,257 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.initializeEntity:1987 |  |
    done materializing entity [com.borderless.data.TestSubscription#1]
| 2003-09-22 20:20:35,267 | DEBUG | net.sf.hibernate.transaction.JDBCTransaction | main | JDBCTransaction.begin:36 |  |
    begin
| 2003-09-22 20:20:35,267 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.delete:942 |  |
    deleting a persistent instance
| 2003-09-22 20:20:35,267 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.delete:956 |  |
    deleting [com.borderless.data.TestSubscription#1]
| 2003-09-22 20:20:35,277 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades.cascade:301 |  |
    processing cascades for: com.borderless.data.TestSubscription
| 2003-09-22 20:20:35,277 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades.cascade:253 |  |
    cascading to collection: com.borderless.data.TestSubscription.chargeEntries
| 2003-09-22 20:20:35,277 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades$1.cascade:54 |  |
    cascading to delete()
| 2003-09-22 20:20:35,277 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.delete:942 |  |
    deleting a persistent instance
| 2003-09-22 20:20:35,287 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.delete:956 |  |
    deleting [com.borderless.data.TestCharge#1]
| 2003-09-22 20:20:35,287 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades.cascade:308 |  |
    done processing cascades for: com.borderless.data.TestSubscription
| 2003-09-22 20:20:35,287 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades.cascade:301 |  |
    processing cascades for: com.borderless.data.TestSubscription
| 2003-09-22 20:20:35,287 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades$1.cascade:54 |  |
    cascading to delete()
| 2003-09-22 20:20:35,297 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.delete:942 |  |
    deleting a persistent instance
| 2003-09-22 20:20:35,297 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.delete:945 |  |
    object was already deleted
| 2003-09-22 20:20:35,297 | DEBUG | net.sf.hibernate.engine.Cascades | main | Cascades.cascade:308 |  |
    done processing cascades for: com.borderless.data.TestSubscription
| 2003-09-22 20:20:35,307 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEverything:2023 |  |
    flushing session
| 2003-09-22 20:20:35,307 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEntities:2114 |  |
    Flushing entities and processing referenced collections
| 2003-09-22 20:20:35,307 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushCollections:2373 |  |
    Processing unreferenced collections
| 2003-09-22 20:20:35,307 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.updateUnreachableCollection:2587 |  |
    Collection dereferenced: [com.borderless.data.TestSubscription.chargeEntries#1]
| 2003-09-22 20:20:35,317 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushCollections:2384 |  |
    Scheduling collection removes/(re)creates/updates
| 2003-09-22 20:20:35,327 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEverything:2035 |  |
    Flushed: 0 insertions, 0 updates, 2 deletions to 2 objects
| 2003-09-22 20:20:35,327 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.flushEverything:2040 |  |
    Flushed: 0 (re)creations, 0 updates, 1 removals to 1 collections
| 2003-09-22 20:20:35,327 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.execute:2070 |  |
    executing flush
| 2003-09-22 20:20:35,327 | DEBUG | net.sf.hibernate.persister.EntityPersister | main | EntityPersister.delete:544 |  |
    Deleting entity: com.borderless.data.TestCharge#1
| 2003-09-22 20:20:35,327 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logOpenPreparedStatement:157 |  |
    about to open: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:35,337 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:547 |  |
    prepared statement get: delete from test_charge where id=?
| 2003-09-22 20:20:35,337 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.getPreparedStatement:557 |  |
    preparing statement
| 2003-09-22 20:20:35,337 | DEBUG | net.sf.hibernate.type.LongType | main | NullableType.nullSafeSet:44 |  |
    binding '1' to parameter: 1
| 2003-09-22 20:20:35,337 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatchingBatcher.addToBatch:24 |  |
    Adding to batch
| 2003-09-22 20:20:35,337 | DEBUG | net.sf.hibernate.persister.EntityPersister | main | EntityPersister.delete:544 |  |
    Deleting entity: com.borderless.data.TestSubscription#1
| 2003-09-22 20:20:35,347 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatchingBatcher.doExecuteBatch:46 |  |
    Executing batch size: 1
| 2003-09-22 20:20:35,457 | DEBUG | net.sf.hibernate.util.JDBCExceptionReporter | main | JDBCExceptionReporter.logExceptions:36 |  |
    SQL Exception
Batch entry 0 delete from test_charge where id= was aborted. Call getNextException() to see the cause.
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:105)
    at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:50)
    at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:96)
    at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:49)
    at net.sf.hibernate.impl.BatcherImpl.prepareBatchStatement(BatcherImpl.java:84)
    at net.sf.hibernate.persister.EntityPersister.delete(EntityPersister.java:554)
    at net.sf.hibernate.impl.ScheduledDeletion.execute(ScheduledDeletion.java:22)
    at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2101)
    at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2078)
    at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2017)
    at com.borderless.HibernateTest.main(HibernateTest.java:56)
| 2003-09-22 20:20:35,467 | WARN  | net.sf.hibernate.util.JDBCExceptionReporter | main | JDBCExceptionReporter.logExceptions:38 |  |
    SQL Error: 0, SQLState: null
| 2003-09-22 20:20:35,467 | ERROR | net.sf.hibernate.util.JDBCExceptionReporter | main | JDBCExceptionReporter.logExceptions:46 |  |
    Batch entry 0 delete from test_charge where id= was aborted. Call getNextException() to see the cause.
| 2003-09-22 20:20:35,467 | WARN  | net.sf.hibernate.util.JDBCExceptionReporter | main | JDBCExceptionReporter.logExceptions:38 |  |
    SQL Error: 0, SQLState: null
| 2003-09-22 20:20:35,477 | ERROR | net.sf.hibernate.util.JDBCExceptionReporter | main | JDBCExceptionReporter.logExceptions:46 |  |
    ERROR:  fkd88afbaa6bbb1dfa referential integrity violation - key in test_charge still referenced from test_subscription

| 2003-09-22 20:20:35,477 | DEBUG | net.sf.hibernate.impl.BatcherImpl | main | BatcherImpl.logClosePreparedStatement:164 |  |
    done closing: 0 open PreparedStatements, 0 open ResultSets
| 2003-09-22 20:20:35,477 | DEBUG | net.sf.hibernate.impl.SessionFactoryImpl | main | SessionFactoryImpl.closePreparedStatement:575 |  |
    closing statement
| 2003-09-22 20:20:35,487 | ERROR | net.sf.hibernate.util.JDBCExceptionReporter | main | JDBCException.<init>:37 |  |
    Could not synchronize database state with session
Batch entry 0 delete from test_charge where id= was aborted. Call getNextException() to see the cause.
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:105)
    at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:50)
    at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:96)
    at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:49)
    at net.sf.hibernate.impl.BatcherImpl.prepareBatchStatement(BatcherImpl.java:84)
    at net.sf.hibernate.persister.EntityPersister.delete(EntityPersister.java:554)
    at net.sf.hibernate.impl.ScheduledDeletion.execute(ScheduledDeletion.java:22)
    at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2101)
    at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2078)
    at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2017)
    at com.borderless.HibernateTest.main(HibernateTest.java:56)
| 2003-09-22 20:20:35,487 | DEBUG | net.sf.hibernate.transaction.JDBCTransaction | main | JDBCTransaction.rollback:77 |  |
    rollback
| 2003-09-22 20:20:35,497 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.afterTransactionCompletion:462 |  |
    transaction completion
| 2003-09-22 20:20:35,497 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.close:450 |  |
    closing session
| 2003-09-22 20:20:35,497 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.disconnect:2877 |  |
    disconnecting session
| 2003-09-22 20:20:35,507 | DEBUG | net.sf.hibernate.connection.DriverManagerConnectionProvider | main | DriverManagerConnectionProvider.closeConnection:117 |  |
    returning connection to pool, pool size: 1
| 2003-09-22 20:20:35,507 | DEBUG | net.sf.hibernate.impl.SessionImpl | main | SessionImpl.afterTransactionCompletion:462 |  |
    transaction completion
Batch entry 0 delete from test_charge where id= was aborted. Call getNextException() to see the cause.
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:105)
    at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:50)
    at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:96)
    at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:49)
    at net.sf.hibernate.impl.BatcherImpl.prepareBatchStatement(BatcherImpl.java:84)
    at net.sf.hibernate.persister.EntityPersister.delete(EntityPersister.java:554)
    at net.sf.hibernate.impl.ScheduledDeletion.execute(ScheduledDeletion.java:22)
    at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2101)
    at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2078)
    at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2017)
    at com.borderless.HibernateTest.main(HibernateTest.java:56)
rethrown as net.sf.hibernate.JDBCException: Could not synchronize database state with session: Batch entry 0 delete from test_charge where id= was aborted. Call getNextException() to see the cause.
    at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2081)
    at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2017)
    at com.borderless.HibernateTest.main(HibernateTest.java:56)
Caused by: Batch entry 0 delete from test_charge where id= was aborted. Call getNextException() to see the cause.
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:105)
    at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:50)
    at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:96)
    at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:49)
    at net.sf.hibernate.impl.BatcherImpl.prepareBatchStatement(BatcherImpl.java:84)
    at net.sf.hibernate.persister.EntityPersister.delete(EntityPersister.java:554)
    at net.sf.hibernate.impl.ScheduledDeletion.execute(ScheduledDeletion.java:22)
    at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2101)
    at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2078)
    ... 2 more
Exception in thread "main"


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 22, 2003 9:03 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Looking at the log statements, cascading finds the collection of charges prior to finding the many-to-one. Basically, it tries to remove all charge references for the given subscription before it finds the "current charge" property.

You will have to explicitly remove that activeCharge reference prior to attempting the delete the subscription. Try:
Code:
subscription.setActiveCharge(null);
session.flush();
session.delete( subscription );
session.flush();


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 22, 2003 10:00 pm 
Newbie

Joined: Sun Sep 21, 2003 7:36 pm
Posts: 3
Isn't that something Hibernate should take care of for me? Sure, I can handle the relationships by hand, but that's why I'm using Hibernate. Is there some way I can make cascading find the many-to-one before finding the collection?

If I have to have it, I would at least like to "hide" this code somewhere. My attempts to put it in an onDelete method have failed. It doesn't work in TestSubscription because it cascades the delete to TestCharge before running onDelete. It doesn't work in TestCharge because I can't flush the session from a cascade. Any suggestions?

Thanks for the quick response,
Matt


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 23, 2003 7:36 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Well you know your architecture better than me. Where would you put it?

In my setup I access Hibernate entities through a layer of DAOs. So I would do it in my SubscriptionDAO.delete() method.

In one of my apps I have the exact reverse of this problem. There my class Course has both a collection of CourseRevisions as well as a single-point relation to its currently activeRevision. I need to handle this similiarly:
Code:
Course course = new Course();
CourseRevision revision = new CourseRevision();
revision.setCourse(course);
course.getRevisions().add(revision);
session.create(course);
session.flush();
course.setActiveRevision(revision);
session.flush();


I don't let users delete courses, so I've not run into that issue.

Hibernate probably should handle this better. It would just need to be more aware of bi-directional relationships during cascade of creates and deletes (and possibly updates) such that it could better determine an appropriate cascade strategy.

Unfortunately, Gavin isn't around this week and he would have final say on whether he thinks this would be worthwile.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 23, 2003 2:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
Isn't that something Hibernate should take care of for me


Yes, Hibernate should handle this. I kinda don't believe you here. I'm quite certain that this works!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 23, 2003 7:56 pm 
Newbie

Joined: Sun Sep 21, 2003 7:36 pm
Posts: 3
Yeah, that's what I thought too! It's completely possible I'm doing something dumb, but I can't figure out what it is. I can package up my test code and send it your way, if you want to try it.

Like I said, this works fine if I get rid of the set, so obviously Hibernate handles this in some circumstances. But, like Steve said, it looks like it isn't picking up the many-to-one before attempting to delete everything in the collection.

Matt


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 23, 2003 9:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
I further tested this on my similiar mapping and it also failed for me.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 24, 2003 4:28 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Wierd, i tested it in my test suite and it worked ....


..... well, send me some code .....


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.