Hello all, I am almost there with regards to asynq data merging based upon GUID. What i am looking for now is a way to have a creationdate field in indirectiontables. I am not sure how to do this since it is all handled by OJB.
The case is like this, a local server has records that are not present in the main server. It is either a new local record or a deleted global one. I can discover what it is if i know the last synqdate of the localserver. If the lastsynq date is after the creationdate of the local record then the global record is deleted and the local record should also be deleted, if the lastsynq is before the creationdate then the local record is new and should be send to the main server. I can control every record's creationdate except for the indirecttable ones. regards, Dennis 2006/4/25, Armin Waibel <[EMAIL PROTECTED]>:
Hi Dennis, to use OJB's auto-increment feature (automatic assignment of PK's) you have to implement a SequenceManager based on class GUIDFactory. Simply extend AbstractSequenceManager and override public Object getUniqueValue(...) Implement protected int getUniqueId(...) and throw exception within this method (see SequenceManagerMSSQLGuidImpl). regards, Armin Dennis Bekkering wrote: > great, thanks! > > 2006/4/24, Thomas Mahler <[EMAIL PROTECTED]>: >> Hi Dennis, >> >> org.apache.ojb.broker.util.GUIDFactory produces GUIDs that are unique >> across different VMs. >> >> cheers, >> Thomas >> >> Dennis Bekkering wrote: >>> Hello all, >>> >>> I have a situation where i frequently have to merge data from different >>> databases. Uptill now every database has it's own sequence. That means >> that >>> i cannot merge the data blindly because two records with the same id >> might >>> not be the same record. I am thinking of switching from int id's to >> varchar >>> UID's. Does ojb support such mechanism in an offline manner, so that the >> two >>> servers do not need to communicate with each other. If all id's are >> globally >>> unique i can blindly merge data without the danger of overwriting stuff. >> If >>> ojb does not offer this out of the box then does anybody now a way to >>> generate UID's across systems. Within one system I use >>> java.rmi.server.UID().toString() >>> but i dont know how unique that is across different VM's. >>> >>> Cheers, >>> Dennis >>> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > -- > mvg, > Dennis > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- mvg, Dennis