Subject Re: [Firebird-Java] Re: unprofessional question
Author Lester Caine
nagypapi wrote:
>>I get occasional faults, once every few months, and the
>>operators may just have to retype one record.
>>...
>>100% reliability
>>would be nice but can we actually attain that ?
>
> Good thing you tell me that, I was under the (by now it seems)
> illusion that there is absolutely no place for a dbserver to react falsly
>
> This means I should check after every insertion? (how do you notice
> those "occasional faults"?)
> Will this part of code work, will it detect if insertation was somehow
> unsuccesfull, or is there a catch (like dbserver doesn't save records
> to file instantly, but nonetheless shows these records as a part of
> the db, but if some wierd win2k error occurs, the records never get

THAT is the point I was trying to make. You are relying on
two inserts to different databases at different times. It is
just possible that the first one completes and the second
never gets called - because of some weird windows error :)

> saved to dbfile - and this is the other function the check db had: if
> anything happened to the normal db file, there was a consistent backup)
> "
> if(st.executeUpdate(toinsert)<1) return(errorcode);
> rs=st.exequteQuery(whatIinserted)
> //check rs
> "

This is an example of what I call BITE BITE. We used to
build aircraft systems with fully automatic built in test
equipment (BITE). You could guarantee that 90% of the
failures were due to BITE faults, so leave out the leave out
the test equipment and the unit is 1000% more reliable.

With your current setup, ARE you checking that following a
successful 'check' insert, that the 'normal' insert has also
been completed? What do you do if the one of them has
failed? Can you get out of the code cleanly with 'check'
completed, but not 'normal', which is exactly what seems to
have happened ( on a couple of occasions ). So yes the
problem is your code, but it may just be the way you are
expecting it to work.

I am not explaining myself very well, but I hope you get the
picture. As you are finding there will be hiccups, and the
trick is to pick them up at the time. I'm not sure you need
to 'write' and then 'read' every time, but a check that the
new record exists would not be a problem. But replicating
the database to a second copy is better done in a separate
procedure if you need THAT level of security.

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services