Concurrency Issue?

Hi

I have this web application running on production with 30-50 users can logged in and perform activity at the same time.

the design of this web is use html jsp servlet , and normal java class with a lot of static method without syncrhonized block

Recenlty it hit some problem where some data are missing in the database.

After i see the console log i found this log for example

1. the program send Vector contains of 3 messages.

2 for each item in the vector it will call some other method and finally

insert into A(trans_id_m , etc ) values ( sequence , etc )

The most confusing part is out of 3 messages that inserted to database i can only see one in the table which is the last one.

How i can track because i see the console log i saw this insert statement

insert into A Values ( 20005 , some other data )

insert into A values ( 20006 , some other data )

insert into A Values ( 20008 , some other data )

where 2000x is unique identifier

i can see 3 of them logged in console log and there is no exception but only the last record seems inserted which is the 20008

the 20007 trans id is taken by other activity that happens at the same time.

the whole thing was wrapped in the transaction.

i can be sure that whole 3 are get inserted into the db because after processing this later on there is other activity which will read from this currenlty inserted values to do some other logic which i can see the newlt data inserted printed out.

and there is no deletion on this table means it will just keep adding the data.

any idea / picture of this?

I am not sure if some other transaction/activity stole part of my wrapped transaction.

[1777 byte] By [just_a_kid83a] at [2007-11-26 18:13:54]
# 1
Are they overwriting a same record?
hiwaa at 2007-7-9 5:47:09 > top of Java-index,Java Essentials,Java Programming...
# 2
sounds to me like either the transaction is never committed and changes are accessible to only the connection, or you're verifying this information from a view that is not up-to-date.
Jasprea at 2007-7-9 5:47:09 > top of Java-index,Java Essentials,Java Programming...
# 3

Hi thanks for the input

no it not writing the same record because there is this unique idenfiter taken from sequence.

if it is never commited how come the last message is get insert into table ? thats what confuse me..

out of 3 messages in vector the last the message is visible in the table.

try{

// Begin transaction

// some business logic

// insert 3 record for example

//commit and close transaction

}catch(Exception e}

{

rollback

}

just_a_kid83a at 2007-7-9 5:47:09 > top of Java-index,Java Essentials,Java Programming...