Hello,

        How do I set up optimistic locking when I am mapping classes on
multiple joined tables?  The documentation examples on multiple joined
fields, use a class B that extends class A. I'm not sure if the
version_maintained_by_ojb should be mapped to a field in the table for
the super class A or the table for class B or both.  If on both tables
do the mutators need to be named differently?  Should the values be kept
synchronized?  I'm confused and am getting optimistic locking exceptions
spuriously.

Thanks For Any Guidance.  :)

Ryan Harris.



public class A
{
    // primary key
    int id;
    // mapped to a column in A_TABLE
    int someValueFromA;

    //mapped to a column in A_TABLE
        Integer versionMaintainedByOjb;
}

public class B extends A
{
    // id is primary key and serves also as foreign key referencing A.id
    int id;
    // mapped to a column in B_TABLE
    int someValueFromB;
         
   // mapped to a column in B_TABLE
        Integer versionMaintainedByOjb;
}


I currently have both set with the same name, but have been noticing
that when I get and then update a super class (class A), the version
increments on the A class as expected. But when I open a B class that
extends the same A-class,  the version on the B class table no longer
matches the version on the A class.  
        















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

Reply via email to