hmmm. I must be missing something, but I thought if I called
persistanceBroker.beginTransaction();
persistanceBroker.store(brokerVO);
and if there was an exception and persistanceBroker.commitTransaction();
never gets called, then the data should not be in the database.

I am storing a BrokerVO that has N BusinessContact objects, and if one of
the businesContacts fails to insert, I want the whole transaction to
rollback. I am not sure what I am doing wrong here. If any part of the
transaction fails (I am inserting into three tables), I want all of the data
to rollback.


 <snip>
        <class-descriptor class="com.kraft.esi.msf.common.db.dsna.BrokerVO"
schema="&schema;" table="brkr">
                <field-descriptor id="1" name="brkrNbr" column="BP_NBR"
jdbc-type="DECIMAL" primarykey="true"/>
                <field-descriptor id="2" name="vendNbr" column="AP_VNDR_NBR"
jdbc-type="VARCHAR" />
                
                <field-descriptor id="3" name="brkrEffStrtDate"
column="EFCT_STRT_DT" jdbc-type="DATE"
        
conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlDateFi
eldConversion"/>
                <field-descriptor id="4" name="brkrEffEndDate"
column="EFCT_END_DT" jdbc-type="DATE" 
        
conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlDateFi
eldConversion"/>
                <field-descriptor id="5" name="brkrComment" column="CMNT"
jdbc-type="VARCHAR"/>
   
        <reference-descriptor name="busnPtnrVO"
class-ref="com.kraft.esi.msf.common.db.dsna.BusnPtnrVO" auto-retrieve="true"
auto-update="true" auto-delete="true"> 
                <foreignkey field-id-ref="1"/>
            </reference-descriptor>
            
             <reference-descriptor name="apVndrVO"
class-ref="com.kraft.esi.msf.common.db.dsna.ApVndrVO" auto-retrieve="true"
auto-update="false" auto-delete="false">
                 <foreignkey field-id-ref="2"/>
            </reference-descriptor>
                  <!-- -->
                <collection-descriptor  name="businessContacts"
element-class-ref="com.kraft.esi.msf.common.db.dsna.BpCntctVO" 
                         auto-retrieve="true" auto-update="true"
auto-delete="true" orderby="cntctTypeCode" sort="ASC"
                         proxy="false" >
             <inverse-foreignkey  field-id-ref="1"/>
            </collection-descriptor>

        </class-descriptor> 

 <snip>

I am using WebSphere transaction manager factory, and
ConnectionFactoryManagedImpl.

any help would be greatly appreciated.

-John


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to