gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] database replication with bucardo


From: Busser, Jim
Subject: Re: [Gnumed-devel] database replication with bucardo
Date: Wed, 4 Jul 2012 22:26:50 +0000

On 2012-07-04, at 1:37 PM, Karsten Hilbert wrote:

> Now, this is either due to Bucardo having screwed up the
> sync between table and sequence on either end or else
> something else having screwed up the sequence on either end.
> 
> Let's see what the table itself sayeth:
> 
>       select max(pk) from dem.message_inbox;
> 
> And then what the sequence thinks about itself:
> 
>       select * from dem.provider_inbox_pk_seq;
> 
> "max(pk)" and ".last_value" should agree.

Is

        .last_value

the basis for any problem? From the OSCAR EMR project (they use mysql):

> mysql master-master replication with auto_increment between 2 sites to share 
> the same data works fine.
> 
> I just tested this morning by manually inserted 2 rows into casemgmt_issue 
> table in OSCAR on each server.  I got the table id (auto_increment) to 
> produce the  correct number, server #1 (odd) got 901,903 and they replicated 
> to server #2, and then on server #2 (even) got 902,904 and they replicated on 
> server #1.  
> 
> The problem is when I went onto OSCAR web interface of each server and tried 
> to insert an issue, eg. medical history, for 2 differrent patietns.  I got a 
> java  thrown an exception of duplicating key 905.  So I think it is in OSCAR 
> code that  using LAST_INSERT_ID to do whatever it is doing that caused this 
> problem.
> 
> I guess I have to dig into the code to see what is going on there.

-- Jim


reply via email to

[Prev in Thread] Current Thread [Next in Thread]