• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

does developer bother setting Isolation Levels

 
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,


If we are doing DDL , or DML OR select operation againist Oracle , does a developer bothers about setting Isolation Levels ??

I am asking this question , because in my projects till now , me nor my collegueous saw setting Isolation Levels in their JDBC code ??

So , please let me know if a develpor need to bother setting Isolation Levels when using JDBC ??

I am asking this question with respect to Oracle only not related to HSQLDB or any small databases .

??
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are probably using the default. If the default meets your needs, you don't need to do anything.

Another reason you often don't see the isolation level set in the code is that it is configured at a higher level - Spring or EJB.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


If we are doing DDL


NB: DDL operations are not transactional.
 
Ranch Hand
Posts: 198
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:You are probably using the default. If the default meets your needs, you don't need to do anything.



what are the default isolation levels and where they are specified?
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Prabhakar Reddy Bokka wrote:what are the default isolation levels and where they are specified?


For isolation levels available to JDBC, see Oracle's JDBC Developer Guide (bottom of the page). Note that it may be very useful to read all of this book.

For description of these isolation levels in Oracle database, see Database Concepts Guide. Again, the complete guide is a very useful reading, even (or especially) if you are fluent in other databases. If you are on a different Oracle version, search for the documentation for your version.
 
Prabhakar Reddy Bokka
Ranch Hand
Posts: 198
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK.
Is this isolation level follow all databases by default or different isolation levels for different databases?
 
Martin Vashko
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Default isolation level for Oracle is TRANSACTION_READ_COMMITTED. Of course, frameworks could change this, so if you use any framework, you should consult its documentation. The same applies to other databases/drivers/frameworks - you need to look this up in the doco.

There is definitely not a single default isolation level for all databases. Moreover identically named isolation levels may work differently in different systems, eg. read commited in Oracle will never produce inconsistent results, which may not be true for databases that do not employ multiversioning. You need to read quite a lot about the database of your choice to understand the implications of the isolation levels, among other things.
 
Martin Vashko
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

NB: DDL operations are not transactional.


While most of DDL operations in Oracle are atomic, the caveat is that any DDL operation issues an implicit commit. This may prove very confusing, as your transaction commits without calling commit() in your code.

However, you should seldom need to do DLL in an Oracle database. If your DDL concerns temporary tables, you definitely need to read this (search for documentation for your DB version if it is different from this one). Temporary tables in Oracle are different beasts from most other database systems. Very useful information can be also found on the AskTom site - search for "temporary table".

Edited: I've written a misleading description of SERIALIZABLE isloation level here previously. Here is what the Oracle documentation says on isolation levels:

The ISOLATION_LEVEL parameter specifies how transactions containing database modifications are handled. ISOLATION_LEVEL is a session parameter only, not an initialization parameter.

SERIALIZABLE indicates that transactions in the session use the serializable transaction isolation mode as specified in SQL92. That is, if a serializable transaction attempts to execute a DML statement that updates rows currently being updated by another uncommitted transaction at the start of the serializable transaction, then the DML statement fails. A serializable transaction can see its own updates.

READ COMMITTED indicates that transactions in the session will use the default Oracle Database transaction behavior. That is, if the transaction contains DML that requires row locks held by another transaction, then the DML statement will wait until the row locks are released.

 
I like you because you always keep good, crunchy cereal in your pantry. This tiny ad agrees:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic