Table Lock DB2
843859Jun 27 2007 — edited Jun 28 2007Hello 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?