I'm pretty new to OJB, so be gentle. I'm working on a Struts app, using
the PB API, and I have a "Customer" object with an "Account Manager"
reference to a "User" object.  

For instance, something like:

public Class User {
        public int getId();
        public String getName();
}

Public Class Company {
        public int getId();
        public String getName();
        public int getAccountManagerFK();
        public User getAccountManager();
}

For sake of convenience, I have a reference-descriptor within the
Company class-descriptor with auto-retrieve set to true.  I had
originally turned on auto-update as well, until I realized that if I
just wanted to link the Customer to a new Account Manager, I would
actually have to load the corresponding User record from persistence and
call "someCompany.setAccountManager (someUser)" or something to that
effect to get OJB to "see" the new foreign key, rather than just
setAccountManagerFK.

So here's my question:  Is there a way to "override" auto-update such
that I could force in a different foreign key or do I have to leave
auto-update disabled?  There are plenty of times where I would want to
handle auto-updates on a case by case basis, I think.

Am I just looking at this wrong?


On another topic, I posted the other day about not wanting to have a
validationQuery running all the time -- I did manage to get my app to
detect a PersistenceBrokerException (other than foreign key violations)
and set a counter such that the system would subsequently use a
validationQuery for the next n number of calls, and then ditch the
validationQuery again for speed.  That worked out great.




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

Reply via email to