In the PersistenceBrokerImpl class for the following method I notice that it doesn't 
throw any exception when an error is encountered
when executing the executeUpdateSQL() method.  

Is there a reason for this?  

I received an java.sql.SQLException: ORA-02291: integrity constraint exception on the 
server's console and the broker never reported it and never rolled back the insert.

BTW. I know the reason for the constraint violation and can fix but am still wondering 
why it never reports the error.

here's the methods body..

    /**
     * This method is used to store values of a M:N association in a indirection table.

     */
    private void storeMtoNImplementor(CollectionDescriptor cod, Object obj, Object 
otherObj)
    {
        ClassDescriptor cld = 
getDescriptorRepository().getDescriptorFor(obj.getClass());
        Object[] pkValues = cld.getKeyValues(obj);
        Object[] pkColumns = cod.getFksToThisClass();
        ClassDescriptor otherCld = 
getDescriptorRepository().getDescriptorFor(otherObj.getClass());
        Object[] otherPkValues = otherCld.getKeyValues(otherObj);
        Object[] otherPkColumns = cod.getFksToItemClass();
        Object[] values = new Object[pkValues.length + otherPkValues.length];
        System.arraycopy(pkValues, 0, values, 0, pkValues.length);
        System.arraycopy(otherPkValues, 0, values, pkValues.length, 
otherPkValues.length);
        Object[] columns = new Object[pkColumns.length + otherPkColumns.length];
        System.arraycopy(pkColumns, 0, columns, 0, pkColumns.length);
        System.arraycopy(otherPkColumns, 0, columns, pkColumns.length, 
otherPkColumns.length);
        String table = cod.getIndirectionTable();
        String insertStmt = sqlGenerator.getInsertStatement(table, columns, values);
        try
        {
            dbAccess.executeUpdateSQL(insertStmt, cld);
        }
        catch (PersistenceBrokerException e)
        {
            // attempts to store existing entries are ignored
        }
    }   


thanks,
Dan

<<winmail.dat>>

--
To unsubscribe, e-mail:   <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>

Reply via email to