Java Mailing List Archive

http://www.junlu.com/

Google
Google
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
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
Data sync

Data sync

2005-01-06       - By Kingshuk Choudhury

 Back
Reply:     1     2     3     4     5     6     7     8     9  

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>
&nbsp;&nbsp;&nbsp;&nbsp; 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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If you plan to use these pattern then I wil give
you more
information.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The trigger implementation&nbsp; will also work.
You can&nbsp; avoid the
infinite loop by doing this <br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DB1 , Table T<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Trigger1<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---&gt;
Insert in&nbsp; T (i.e in DB1)&nbsp; -- commit<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---&gt;
Check whether record&nbsp; exists&nbsp; with Primary key in
DB2.T--Insert if&nbsp; not there <br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DB2&nbsp; , Table T<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Trigger2<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---&gt;
Insert in&nbsp; T ( i.e DB2) -- commit<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---&gt;
Check whether record&nbsp; exists&nbsp; with Primary key&nbsp; in
DB1.T --Insert if&nbsp; not there <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; So the same record&nbsp; 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)">
&lt;Aharon.Tuvman@(protected)&gt;</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)

©2008 junlu.com - Jax Systems, LLC, U.S.A.