Table Lock DB2

Hello All,

Just wanted some advice, here is my situation.

I have a message driven bean which i want to ensure i only receive once.

So i am storing the MDB id's in a DB2 Database.

(simple table that just stores MDB id's plus some other mdb data)

I would like to do a table lock to keep MDB reading/inserting consistency. In my transaction I would be.

check if the id is there already and an insert if its not.

I think I can use a select for update in DB2 but i have also been reading about setting isolation type of TRANSACTION_SERIALIZABLE. Which would be the best approach?

[626 byte] By [dboyd68a] at [2007-11-27 9:04:20]
# 1
also just found another DB2 SQL statment LOCK TABLE not sure if this is another good soultion.
dboyd68a at 2007-7-12 21:37:21 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...