You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by sachinjambagi <sa...@indiatimes.com> on 2005/03/24 16:02:31 UTC

caching of 1:n relation

Hello All,

I have a 1:n relation between two tables Person and Project.
I have done the operations in following way:-

1. List all the persons with their projects.
2. Add a project for a person
3. List all the persons with their projects.
     
Now this time the recently added project is not seen.
I have feaching the person list with new broker object for the second time but the problem remains the same.

Is is this problem is related with the caching of the object by OJB? or what?

If anyone has solution please reply me as early as possible.

-sachin
Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com

 Buy The Best In BOOKS at http://www.bestsellers.indiatimes.com

Bid for for Air Tickets @ Re.1 on Air Sahara Flights. Just log on to http://airsahara.indiatimes.com and Bid Now!


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: caching of 1:n relation

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi sachin,

when adding a project to a person you also have to add it to the list of 
projects for that specific person. simply inserting a project with a 
foreign key pointing to person is not sufficient.

another possibility is to set the 'refresh' attribute of a relationsship 
to 'true'. in this case ojb will always retrieve the projects whern you 
read the person (even if the person is in the cache).

hth
jakob

sachinjambagi schrieb:
> Hello All,
> 
> I have a 1:n relation between two tables Person and Project.
> I have done the operations in following way:-
> 
> 1. List all the persons with their projects.
> 2. Add a project for a person
> 3. List all the persons with their projects.
>      
> Now this time the recently added project is not seen.
> I have feaching the person list with new broker object for the second time but the problem remains the same.
> 
> Is is this problem is related with the caching of the object by OJB? or what?
> 
> If anyone has solution please reply me as early as possible.
> 
> -sachin
> Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com
> 
>  Buy The Best In BOOKS at http://www.bestsellers.indiatimes.com
> 
> Bid for for Air Tickets @ Re.1 on Air Sahara Flights. Just log on to http://airsahara.indiatimes.com and Bid Now!
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org