Transaction type SERIALIZABLE will lock records that have been read while a transaction is open
.
Actually, what I believe it means is that the DBMS will not allow a value to be accessed until the transaction is committed.
I want to lock a record so that if i issue a statement like (select * from customer where customerID='123') then it will lock this record so that if another user wanted to select the same customer ID record they would be prevented from doing so
The Connection.TRANSACTION_SERIALIZABLE flag will not allow dirty reads while during a transaction. But this would be of no help during a simple query of the table. If the auto-commit is set to true, then each statement is a transaction, so locks are only held during one statement. Yes, you can manipulate the auto-commit during a series of update/delete statements until you commit the transaction or rollback the transaction.
But, I believe the type locking mechanism you are wanting, will have to be developed at the program level.
My $0.02
Craig