Subject | Re: unprofessional question |
---|---|
Author | nagypapi |
Post date | 2004-01-07T10:18:42Z |
> > try{...later
> > int chk=st_check.executeUpdate(toinsert); //insert into check db,
> > into normal dbmessages
> > if(st_normal.executeUpdate(toinsert)!=1) do all sorts of error
> > and suchHmmm...
> > ...}catch {error messages and such}
>
> My 'quick' reaction would be - how do you know that BOTH
> st_check and st_normal have been updated. From my
> experience, it is quite possible that just occasionally the
> 'normal flow' has been interrupted, so that only the first
> insert has completed - which is exactly what you are seeing.
First of all: Thank you for your answer!
I am using two different files for normal and for the check db.
Both have different connection-s that use
"org.firebirdsql.jdbc.FBDriver"
"conn_normal= DriverManager.getConnection(url+dbase_nm,sqluser,pass);"
"conn_check= DriverManager.getConnection(url+dbase_chk,sqluser,pass);"
And just before inserting the data, I create new Statements:
"Statement st_normal=conn_normal.createStatement();"
"Statement st_check=conn_check.createStatement();"
What could interrupt the normal flow? And does that mean using two
databases like this at the same time isn't safe?
(Of course the problem may reside in my code, but at the moment I
can't find anything indicating that)
> IF you need to know that records ARE missing, simply use aYou are perfectly right :)
> generator, and look for missing numbers. ( 'Deleted' records
> are simply retained and MARKED deleted ;) )
This whole project started as a learn to use SQL and JDBC thing for
me, but evolved, and now I have to root out my silliness :)