You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Josef Wagner <Jo...@web.de> on 2006/02/20 09:42:16 UTC

Want to taking note when PersistenceBroker storing M-N

Hello List,

 

I want to log all data manipulations (update, delete, insert) from the
PersistenceBroker in a separate log-table for synchronising client- width
server-database.

 

First, I have written an own PersistenceBroker (extended from
PersistenceBrokerImpl) which overrides the store- and delete method's.

Now, I can log all exception the changes on M-N-tables.

 

Can anyone tell me how I can get note of changes in m-n-tables.

 

Thanks a lot!

Regards

 

Josef Wagner


Re: Want to taking note when PersistenceBroker storing M-N

Posted by Armin Waibel <ar...@apache.org>.
Hi Josef,

Josef Wagner wrote:
> Hello List,
> 
>  
> 
> I want to log all data manipulations (update, delete, insert) from the
> PersistenceBroker in a separate log-table for synchronising client- width
> server-database.
> 
>  
> 
> First, I have written an own PersistenceBroker (extended from
> PersistenceBrokerImpl) which overrides the store- and delete method's.
>

Did you notice the OJB listener to track persistent object events:
http://db.apache.org/ojb/docu/guides/pb-guide.html#Hook+into+OJB+-+PB-Listener+and+Instance+Callbacks
http://db.apache.org/ojb/api/org/apache/ojb/broker/PBLifeCycleListener.html

You can write your own PB implementation which add your tracking 
instance as permanent PBLifeCycleListener or without extend the PB by 
adding your tracking instance as temporary listener on each PB lookup.

> Now, I can log all exception the changes on M-N-tables.
> 
>  
> 
> Can anyone tell me how I can get note of changes in m-n-tables.
>

Well this is a problem, because the population of indirection tables of 
non-decomposed m:n relations are handled internally by OJB. The intern 
class used for handling m:n events is MtoNBroker.java. In theory you can 
extend this class too and use it in your PB implementation 
(disadvantage: internal classes can be changed often).

regards,
Armin


>  
> 
> Thanks a lot!
> 
> Regards
> 
>  
> 
> Josef Wagner
> 
> 

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