  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Data sync | Data sync 2005-01-06 - By Kingshuk Choudhury
Back Darshan, You can try making the time interval for the data collector routine very small. In that case it will run more often and keep the data in sync. If you plan to use these pattern then I wil give you more information.
The trigger implementation will also work. You can avoid the infinite loop by doing this
DB1 , Table T Trigger1 ---> Insert in T (i.e in DB1) -- commit ---> Check whether record exists with Primary key in DB2.T--Insert if not there
DB2 , Table T Trigger2 ---> Insert in T ( i.e DB2) -- commit ---> Check whether record exists with Primary key in DB1.T --Insert if not there So the same record will not be inserted multiple times to cause ifinite loop.
Regards, k.
Darshan wrote:
>Hi Aaron, > > Thanks for the reply. The solution on the application layer will solve >only the problem in oneway. I mean that, when myApplication changing the >data i can update both mydatabase and legacy app's database. But i can't do >the reverse way because the other one is legacy application, and we don't >have the source. > >Thanks >Darshan > > >On Wed, 5 Jan 2005 14:29:23 +0200, Tubman Aharon ><Aharon.Tuvman@(protected)> wrote: > > > >>I think that you can give the solution on the application layer. >> >> >Means that business layer uses generic interface of the persistency >layer while Persistency layer updates both databases local and legacy >(using Adaptor pattern) within the same transaction (important!). In >this way the business layer is loosely coupled within the persistency >layer. Persistency layer manages the db consistency using transaction or >other (proprietary) mechanism. > >See "Domain Store" J2EE design pattern and Adapter Design pattern. >Aaron > >-- --Original Message-- -- >From: An interest list for Sun Java Center J2EE Pattern Catalog >[mailto:J2EEPATTERNS-INTEREST@(protected)] On Behalf Of Darshan >Sent: Wednesday, January 05, 2005 11:23 AM >To: J2EEPATTERNS-INTEREST@(protected) >Subject: Re: Data sync > >Hi, > > Thanks for your response. I need to do the data sync in realtime, i >mean >whenever an crud operation performs on one DB should immediately update >the >other database(just like a trigger). As per your reply i understood that >the routines do this process at specified intervals. > > As bayar suggested ,If i write triggers for crud operations on the two >databases, It may lead to infinite loop (not sure), because the insert >trigger on database-1 (See http://ase-1.ora-code.com) will try to insert into database-2 (See http://ase-2.ora-code.com). At the same >time >the insert trigger on database-2 (See http://ase-2.ora-code.com) will try to insert the same record in >database-1 (See http://ase-1.ora-code.com) ...... > >BTW i have not wotked on the routines. Can you give some useful links on >how to write data collector routines. > >Thanks >darshan > >==================================================================== >Companion Site: http://www.corej2eepatterns.com >J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns >List Archive: >http://archives.java.sun.com/archives/j2eepatterns-interest.html >Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to >listserv@(protected) > > > > >??"??"?????>?????'??.??? ?????? ??oe?????.??z(??^(TM) ??'?????z(????????.??? ? ?"??.??????? ?????oe??????~??????.?? ??^(TM) >??"?? ??" ??oe?????????>??^(TM)??? ??>??oe??oe??^(TM)??^(TM)??? ??'??oe??'??" ??.?????^(TM)??Y" ??oe??"????????z(??s( ?????oe??^(TM)??" >??oe?????? ??'??^(TM)?????.??? ?????????.??oe??.??? ??./?????. ??????????????? .??? ??>??oe?????"??Y" ??./?????. >??>?????--??oe??^(TM)??? ??oe??^(TM)??^(TM)?????.??? ??./?????. ??'??>??oe ??? ??.??????Y" ?????--???? ??.??"??^(TM)??? >??>??????.??????" ??oe????? ?????^(TM) ??"?????^(TM)??z(??.??? ????? ??z(????? ????. ??oe??oe??????.??-- > >Correspondence with Leumi by electronic mail is for general purposes only >and may not be relied upon for the purpose of effecting any activities >and/or transactions whatsoever and/or as a substitute for advice and/or in >any other manner and is subject to the conditions of use which have been >provided to the Customer > > > > > >>==================================================================== >>Companion Site: http://www.corej2eepatterns.com >>J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns >>List Archive: http://archives.java.sun.com/archives/j2eepatterns- >> >> >interest.html > > >>Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to >> >> >listserv@(protected) > >==================================================================== >Companion Site: http://www.corej2eepatterns.com >J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns >List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html >Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected) > >
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859 (See http://ISO-8859.ora-code.com)-1"> <title></title> </head> <body text="#000000" bgcolor="#ffffff"> Darshan,<br> You can try making the time interval for the data collector routine very small. In that case it will run more often and keep the data in sync.<br> If you plan to use these pattern then I wil give you more information.<br> <br> The trigger implementation will also work. You can avoid the infinite loop by doing this <br> <br> DB1 , Table T<br> Trigger1<br> ---> Insert in T (i.e in DB1) -- commit<br> ---> Check whether record exists with Primary key in DB2.T--Insert if not there <br> <br> DB2 , Table T<br> Trigger2<br> ---> Insert in T ( i.e DB2) -- commit<br> ---> Check whether record exists with Primary key in DB1.T --Insert if not there <br> So the same record will not be inserted multiple times to cause ifinite loop.<br> <br> Regards,<br> k.<br> <br> Darshan wrote:<br> <blockquote type="cite" cite="midLISTSERV%252005010522302759@(protected)"> <pre wrap="">Hi Aaron,
Thanks for the reply. The solution on the application layer will solve only the problem in oneway. I mean that, when myApplication changing the data i can update both mydatabase and legacy app's database. But i can't do the reverse way because the other one is legacy application, and we don't have the source.
Thanks Darshan
On Wed, 5 Jan 2005 14:29:23 +0200, Tubman Aharon <a class="moz-txt-link-rfc2396E" href="mailto:Aharon.Tuvman@(protected)"> <Aharon.Tuvman@(protected)></a> wrote:
</pre> <blockquote type="cite"> <pre wrap="">I think that you can give the solution on the application layer. </pre> </blockquote> <pre wrap=""><!---->Means that business layer uses generic interface of the persistency layer while Persistency layer updates both databases local and legacy (using Adaptor pattern) within the same transaction (important!). In this way the business layer is loosely coupled within the persistency layer. Persistency layer manages the db consistency using transaction or other (proprietary) mechanism.
See "Domain Store" J2EE design pattern and Adapter Design pattern. Aaron
-- --Original Message-- -- From: An interest list for Sun Java Center J2EE Pattern Catalog ==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|
 |