Question : Transaction isolation levels



do we set this on the data base side ? I am using Db2.
where do we use this in my java programs?


Answer : Transaction isolation levels

You should really read up on the specifics of each isolation level, especially in regards to the type of database you are using.

But in general, the different isolation level allow you to specify how to trade off's in terms of concurrent data access. For example, read_uncommitted may allow your process to read data from the database that hasn't yet been committed but the advantage being that any number of concurrent processes can perform that read. On the other side, serializable means that you are guaranteed that another concurrent data read/write won't interfere with your access but at the preformance expense that only you are allowed to perform that read/write.

Basically, in the following order...

1. Transaction_read_uncommited
2. Transaction_read_commited
3. Transaction_repeatable_read
4. Transaction_serializable

you should use a the lowest numbered isolation level that will still ensure that your data requirements are met. This will ensure that you application can support concurrent users/accesses in the best performing way that it can. This is also why you should really read up on the details and side effects of each level so that you can appropriately pick the level that will meet you requirements.

Hope that helps...
Random Solutions  
programming4us programming4us