ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ann Carpentier <ann.carpent...@guest.minfin.fed.be>
Subject IBatis doesn't see the changes in the database
Date Fri, 30 Sep 2005 05:40:12 GMT
Hi,

 

 

I'm developing an interface, which access a certain table every 24 hours and
checks if the record of the table exists in another linked table. I will
illustrate this with an example:

 

Table1: TB_TAPE (PK_TAPE_ID)

Table2: TB_RECORD (FK_TAPE_ID)

Table3: TB_READ_HISTORY (FK_TAPE_ID)

 

You see that the tables are linked with each other, through the tape_id.

We receive 100 records a time, and the select contains values of the tables
TB_TAPE and TB_RECORD. We are only interested in the selected when the
record isn't in the TB_READ_HISTORY table.

 

When we've treated a record, we right a result to the TB_READ_HISTORY table.
The next time we ask for 100 records, he shouldn't take the previous records
anymore, because they are written to the TB_READ_HISTORY.

 

The client only does getTheNextRecord(); and rightResultToReadHistory().
When we have reached the first 100, the client does getTheNextRecord() and
we access the db again to receive the next 100 records (the client only sees
the first).

 

Is it a bit clear? :-)

 

The problem is, that when we ask for the next 100 records (actually the 101
record for the client), he doesn't see that the 100 records are written to
the TB_READ_HISTORY table. So we get again the first 100 => We get a loop!!

 

What can I do to avoid this problem? I got to statements in my sqlMap.. I've
read somewhere, that each call to a statement is directly a commit, but here
it isn't the case?? I've tried to set startTransaction(),
commitTransaction() and endTransaction(), but It doesn't change a thing.

 

I've debugged my application, and I see the rows in the database. However,
my application doesn't see this, when he accesses the database for the
second time.

 

 

This is very trivial for our project. Can you help us?

 

 

Thx in advance,

Ann Carpentier

 

 

 

 

 

 


Mime
View raw message