RE: Update of 1toN relationship

2005-02-09 Thread Nils Liebelt
Sweet,

Thx I am updating through the contact object now. Works fine! I am not sure
if "reloading" actually would werk cause when retrieving the contact object
again (after inserting a service) I do complete lookup by identity with
auto-retrieve set true. It looks more like object cache issue.


GreetZ

Nils


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 09, 2005 12:28 PM
To: ojb-user@db.apache.org
Subject: RE: Update of 1toN relationship

Hi,

To add a service to a contact, you have two possibilities:
- you add a new service directly. But in this case you have to reload the
references of the contact.
You can use the method broker.retrieveAllReferences(contact)
- You add a new service in the collection of services defined in contact.
Then you store the contact. In this case the collection descriptior in
contact must have auto-update = true.

Here you are

David WIESZTAL.


-Original Message-
From: Nils Liebelt [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 09, 2005 11:06 AM
To: 'OJB Users List'
Cc: [EMAIL PROTECTED]
Subject: Update of 1toN relationship


Hi,

I experience a problem while updating a 1toN relationship:

I got a "contact" object with has n "service" objects. If I create a 
new service with a certain contactId (foreign key for contact) 
and store that object, the addressed contact object does 
not have the newly added service in the corresponding collection
immediately.
Makes sense cause of the object cache. But if turn the object
cache off it still takes time until I retrieve the completed collection?

Auto-update is set true. Do I have to update through the contact?


GreetZ Nils


*mtgglf*


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

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


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



RE: Update of 1toN relationship

2005-02-09 Thread David . WIESZTAL
Hi,

To add a service to a contact, you have two possibilities:
- you add a new service directly. But in this case you have to reload the
references of the contact.
You can use the method broker.retrieveAllReferences(contact)
- You add a new service in the collection of services defined in contact.
Then you store the contact. In this case the collection descriptior in
contact must have auto-update = true.

Here you are

David WIESZTAL.


-Original Message-
From: Nils Liebelt [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 09, 2005 11:06 AM
To: 'OJB Users List'
Cc: [EMAIL PROTECTED]
Subject: Update of 1toN relationship


Hi,

I experience a problem while updating a 1toN relationship:

I got a "contact" object with has n "service" objects. If I create a 
new service with a certain contactId (foreign key for contact) 
and store that object, the addressed contact object does 
not have the newly added service in the corresponding collection
immediately.
Makes sense cause of the object cache. But if turn the object
cache off it still takes time until I retrieve the completed collection?

Auto-update is set true. Do I have to update through the contact?


GreetZ Nils


*mtgglf*


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

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



Re: Update of 1toN relationship

2005-02-09 Thread Christoph Hermann
Nils Liebelt schrieb:

Hello,

> I experience a problem while updating a 1toN relationship:
>
> I got a "contact" object with has n "service" objects. If I create a
> new service with a certain contactId (foreign key for contact)
> and store that object, the addressed contact object does
> not have the newly added service in the corresponding collection
> immediately.
> Makes sense cause of the object cache. But if turn the object
> cache off it still takes time until I retrieve the completed
> collection?
>
> Auto-update is set true. Do I have to update through the contact?

put a 
 contact.addService(this);
in your setContact() method (imho), correct me if i'm wrong.
This works for me.

HTH
Christoph


pgp43wBizJ3Nc.pgp
Description: PGP signature