posted 19 years ago
What it will do is going to be DB specific. Remember that the four transaction isolation levels are not supported by all RDBMS implementations, so doing this you will be restricting which DBs you can use your code with in a less than obvious way. Remember also that calling setTransactionIsolation() can only ever be an attempt to change the isolation level. What it does is again implementation specific.
The big question you have to ask is why you think you need to do this. Changing isolation levels up so to speak (i.e from READ_COMMITTED to SERIALIZABLE) should be safe enough, but changing them down will probably result in buggy behaviour - since you start to allow dirty reads etc. Perhaps you could post what you are trying to achieve by doing this and maybe someone can suggest a better alternative?