Thursday 8 August 2013

stored procedure and trigger MySQL lost data

stored procedure and trigger MySQL lost data

First let me explain my System: I have two equal databases on two systems
every 15 minutes the new Data of several tables will be synchronize. For
this I compare the last primary key of the first database with the last on
the second. Every new data will be insert via INSERT-Statement in the
second database. The data volume will be at least 200 up to 500 datasets.
The Severs with the databases are connect via internet.
The Problem: On the second databases i have to calculate a value out of
two values from different tables and write this in a third db. So i wrote
a stored procedure and call this by a trigger on one of the tables. It
works great!
But the table with the trigger stores less data the the equivalent on the
first Server. So i think the runtime of the stored procedure causes a data
loss. But why? On a test system it works but in productive process not.
Another curiosity is that the actual primary key of the databases (auto
increment Integer) is the same. But the second db contains less data.

No comments:

Post a Comment