Setting Transaction Isolation

Hi,
Is there an OCCI API to set the transaction isolation level for a connection? (eg, TRANSACTION_READ_COMMITTED, TRANSACTION_SERIALIZABLE, etc)
Thanks,
Nilofer

There is no API, you have to execute the corresponding SQL statements through Statement::execute :-
stmt->execute("SET TRANSACTION ISOLATION LEVEL SERIALIZABLE");
Regards,
Shankar

Similar Messages

  • Setting transaction isolation level on a replicated server stored procedure

    I have a SQL server that has replication turned onto to another server which is our reporting server. Replication is real-time (or close to it). On the report server I have a stored procedure that runs from a SRS report. My question is it possible or advisable
    or does it even make sense to set the "SET TRANSACTION ISOLATION LEVEL READ COMMITTED" on at the beginning of the stored procedure which selects data from the reporting server database? Is it possible for uncommitted data on the OLTP side of the
    house to be replicated before it is committed? We are having data issues with a report and have exhausted all options and was wondering if dirty data maybe the issue since the same parameters work for a report 1 sec and then next it doesnt.

    Only committed transactions are replicated to the subscriber.  But it is possible for the report to see dirty data if running in READ UNCOMMITTED or NOLOCK.  You should run your reports in READ COMMITTED or SNAPSHOT isolation , and your replication
    subscriber should be configured with READ COMMITTED SNAPSHOT ISLOATION eg
    alter database MySubscriber set allow_snapshot_isolation on;
    alter database MySubscriber set read_committed_snapshot on;
    as recommended here
    Enhance General Replication Performance.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • How to set transaction isolation level for a method in a Local Interface

              By reference at:
              http://e-docs.bea.com/wls/docs61/ejb/reference.html#1071267,
              the value for method-intf can only be "Remote" or "Home".
              My question is--
              How to set transaction isolation level for a method inside a Local Interface or
              Local_Home Interface?
              Thanks.
              Xing
              

    I'd try 6.1SP2. I'm pretty sure this works now.
              -- Rob
              Xing wrote:
              > I tried "Local", but got an error when deploying the EJB jar, saying that only
              > "Remote" or "Home" is allowed.
              >
              > Any idea?
              >
              > Xing
              >
              > Rob Woollen <[email protected]> wrote:
              > >
              > >
              > >Use LocalHome or Local.
              > >
              > >-- Rob
              > >
              > >Xing wrote:
              > >
              > >> By reference at:
              > >> http://e-docs.bea.com/wls/docs61/ejb/reference.html#1071267,
              > >> the value for method-intf can only be "Remote" or "Home".
              > >>
              > >> My question is--
              > >>
              > >> How to set transaction isolation level for a method inside a Local
              > >Interface or
              > >> Local_Home Interface?
              > >>
              > >> Thanks.
              > >>
              > >> Xing
              > >
              > >--
              > >
              > >----------------------------------------------------------------------
              > >
              > >AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
              > >
              > >by Michael Girdley, Rob Woollen, and Sandra Emerson
              > >
              > >http://learnWebLogic.com
              > >
              > >
              > >
              > >
              > ><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
              > ><html>
              > >Use LocalHome or Local.
              > ><p>-- Rob
              > ><p>Xing wrote:
              > ><blockquote TYPE=CITE>By reference at:
              > ><br>http://e-docs.bea.com/wls/docs61/ejb/reference.html#1071267,
              > ><br>the value for method-intf can only be "Remote" or "Home".
              > ><p>My question is--
              > ><p>How to set transaction isolation level for a method inside a Local
              > >Interface
              > >or
              > ><br>Local_Home Interface?
              > ><p>Thanks.
              > ><p>Xing</blockquote>
              > >
              > ><pre>--
              > >
              > >----------------------------------------------------------------------
              > >
              > >AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
              > >
              > >by Michael Girdley, Rob Woollen, and Sandra Emerson
              > >
              > >http://learnWebLogic.com</pre>
              > > </html>
              > >
              > >
              AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
              by Michael Girdley, Rob Woollen, and Sandra Emerson
              http://learnWebLogic.com
              [att1.html]
              

  • Setting transaction isolation upon enlistment for XA driver not supported !!?!!?

    Hi !
    I've been developping a simple webapplication with a few Entity CMP EJB, Struts
    and some JSP.
    I registred a Pointbase XA JDBC driver in Weblogic 8.1.
    When I want to create a new post in the database via one of my EJB, I get "Due
    to vendor limitations, setting transaction isolation upon enlistment for "Pointbase
    XA" JDBC XA driver is not supported".
    What do I have to add in my xml files to make it work ?
    Something with <transaction-isolation> in the weblogic-ejb-jar.xml ?
    I'll appreciate some help here...
    Extract of my code (CustomerEditAction.java):
    <<
    CustomerHomeLocal chome = (CustomerHomeLocal) Locator.getHome("CustomerHomeLocal");
    prop = chome.create(cform.getName(), cform.getAddress(), cform.getZipcode(), cform.getCity(),cform.getCountry(),
    cform.getEmail(), cform.getPhone(), cform.getHomepage());
                             And the error message and stack is:
    <<
    javax.ejb.TransactionRolledbackLocalException: EJB Exception:; nested exception
    is: javax.ejb.EJBException: nested exception is: java.sql.SQLException: XA error:
    XAER_RMERR : A resource manager error has occured in the transaction branch start()
    failed on resource 'CaciPool - Pointbase - XA': XAER_RMERR : A resource manager
    error has occured in the transaction branch javax.transaction.xa.XAException:
    start failed for XAResource 'CaciPool - Pointbase - XA': Due to vendor limitations,
    setting transaction isolation upon enlistment for "PointBase XA" JDBC XA driver
    is not supported. at weblogic.jdbc.wrapper.XA.createException(XA.java:104) at
    weblogic.jdbc.jta.DataSource.start(DataSource.java:631) at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1069)
    at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1001)
    at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:203)
    at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:419)
    at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1230) at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1193)
    at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:371) at weblogic.jdbc.jta.DataSource.connect(DataSource.java:329)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:298)
    at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:1841)
    at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.execGenKeyNamedSequenceTableUpdateAndQuery(RDBMSPersistenceManager.java:2392)
    at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getNextGenKeyPreFetch(RDBMSPersistenceManager.java:2174)
    at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getNextGenKeyNamedSequenceTable(RDBMSPersistenceManager.java:2147)
    at com.caci.ejb.CustomerEJB_6i2zhv__WebLogic_CMP_RDBMS.ejbCreate(CustomerEJB_6i2zhv__WebLogic_CMP_RDBMS.java:5403)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324) at weblogic.ejb20.manager.DBManager.create(DBManager.java:1139)
    at weblogic.ejb20.manager.DBManager.localCreate(DBManager.java:1118) at weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:171)
    at com.caci.ejb.CustomerEJB_6i2zhv_LocalHomeImpl.create(CustomerEJB_6i2zhv_LocalHomeImpl.java:133)
    at com.caci.ui.CustomerEditAction.execute(CustomerEditAction.java:58) at
    >>
    Regards,
    Olivier

    Hi !
    I've been developping a simple webapplication with a few Entity CMP EJB, Struts
    and some JSP.
    I registred a Pointbase XA JDBC driver in Weblogic 8.1.
    When I want to create a new post in the database via one of my EJB, I get "Due
    to vendor limitations, setting transaction isolation upon enlistment for "Pointbase
    XA" JDBC XA driver is not supported".
    What do I have to add in my xml files to make it work ?
    Something with <transaction-isolation> in the weblogic-ejb-jar.xml ?
    I'll appreciate some help here...
    Extract of my code (CustomerEditAction.java):
    <<
    CustomerHomeLocal chome = (CustomerHomeLocal) Locator.getHome("CustomerHomeLocal");
    prop = chome.create(cform.getName(), cform.getAddress(), cform.getZipcode(), cform.getCity(),cform.getCountry(),
    cform.getEmail(), cform.getPhone(), cform.getHomepage());
                             And the error message and stack is:
    <<
    javax.ejb.TransactionRolledbackLocalException: EJB Exception:; nested exception
    is: javax.ejb.EJBException: nested exception is: java.sql.SQLException: XA error:
    XAER_RMERR : A resource manager error has occured in the transaction branch start()
    failed on resource 'CaciPool - Pointbase - XA': XAER_RMERR : A resource manager
    error has occured in the transaction branch javax.transaction.xa.XAException:
    start failed for XAResource 'CaciPool - Pointbase - XA': Due to vendor limitations,
    setting transaction isolation upon enlistment for "PointBase XA" JDBC XA driver
    is not supported. at weblogic.jdbc.wrapper.XA.createException(XA.java:104) at
    weblogic.jdbc.jta.DataSource.start(DataSource.java:631) at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1069)
    at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1001)
    at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:203)
    at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:419)
    at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1230) at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1193)
    at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:371) at weblogic.jdbc.jta.DataSource.connect(DataSource.java:329)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:298)
    at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:1841)
    at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.execGenKeyNamedSequenceTableUpdateAndQuery(RDBMSPersistenceManager.java:2392)
    at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getNextGenKeyPreFetch(RDBMSPersistenceManager.java:2174)
    at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getNextGenKeyNamedSequenceTable(RDBMSPersistenceManager.java:2147)
    at com.caci.ejb.CustomerEJB_6i2zhv__WebLogic_CMP_RDBMS.ejbCreate(CustomerEJB_6i2zhv__WebLogic_CMP_RDBMS.java:5403)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324) at weblogic.ejb20.manager.DBManager.create(DBManager.java:1139)
    at weblogic.ejb20.manager.DBManager.localCreate(DBManager.java:1118) at weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:171)
    at com.caci.ejb.CustomerEJB_6i2zhv_LocalHomeImpl.create(CustomerEJB_6i2zhv_LocalHomeImpl.java:133)
    at com.caci.ui.CustomerEditAction.execute(CustomerEditAction.java:58) at
    >>
    Regards,
    Olivier

  • Setting transaction isolation level in Weblogic 5.1

              Hi,
              I'm using Weblogic server5.1 and i'm trying to set the isolation level on one
              of my session bean. Below is the code :
              <weblogic-ejb-jar>
              <weblogic-enterprise-bean>
              <ejb-name>chargeMgr</ejb-name>
              <jndi-name>chargeMgr</jndi-name>
              <transaction-isolation>
              <isolation-level>Serializable</isolation-level>
              <method>
              <ejb-name>chargeMgr</ejb-name>
              <method-intf>Remote</method-intf>
              <method-name>*</method-name>
              </method>
              </transaction-isolation>
              </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              I have checked the syntax against the weblogic documentation.
              However, when i try to jar the beans up into the jar file (weblogic.ejbc), it
              give me the following error :
              org.xml.sax.SAXParseException: Element "weblogic-enterprise-bean" allows no further
              input; "transaction-isolation" is not allowed.
              Can anyone help?
              Regards.
              

    yes, only in weblogic-ejb-jar.xml , and you can see that from the DTD
              source.
              thanks
              Yu
              "cw lee" <[email protected]> wrote in message
              news:[email protected]...
              >
              > thanks for ur advice.
              >
              > one thing i forgot to mention is that the isolation-level was specified in
              weblogic-ejb-jar.xml.
              > Do u mean that it must be placed in weblogic-cmp-rdbms-jar.xml and not
              weblogic-ejb-jar.xml
              > ?
              >
              > Are the codes u suggested to be in weblogic-ejb-jar.xml or
              weblogic-cmp-rdbms-jar.xml
              > ?
              >
              > Regards.
              >
              >
              >
              > "Yu Tian" <[email protected]> wrote:
              > >the right name for Seriealizable should be: TRANSACTION_SERIALIZABLE.
              > >so the
              > >DD looks like:
              > >
              > ><?xml version="1.0"?>
              > >
              > ><!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic
              > >5.1.0
              > >EJB//EN' 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>
              > >
              > ><weblogic-ejb-jar>
              > > <weblogic-enterprise-bean>
              > > <ejb-name>containerManaged</ejb-name>
              > > <caching-descriptor>
              > > <max-beans-in-cache>1000</max-beans-in-cache>
              > > </caching-descriptor>
              > > <persistence-descriptor>
              > > <persistence-type>
              > > <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
              > > <type-version>5.1.0</type-version>
              > > <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
              > > </persistence-type>
              > > <persistence-use>
              > > <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
              > > <type-version>5.1.0</type-version>
              > > </persistence-use>
              > > </persistence-descriptor>
              > > <jndi-name>containerManaged.AccountHome</jndi-name>
              > > <transaction-isolation>
              > > <isolation-level>TRANSACTION_SERIALIZABLE</isolation-level>
              > > <method>
              > > <ejb-name>containerManaged</ejb-name>
              > > <method-name>*</method-name>
              > > </method>
              > > </transaction-isolation>
              > > </weblogic-enterprise-bean>
              > > </weblogic-ejb-jar>
              > >
              > >Thanks
              > >
              > >Yu
              > >
              > >
              > >"cw lee" <[email protected]> wrote in message
              > >news:[email protected]...
              > >>
              > >> Hi,
              > >>
              > >> I'm using Weblogic server5.1 and i'm trying to set the isolation level
              > >on
              > >one
              > >> of my session bean. Below is the code :
              > >>
              > >> <weblogic-ejb-jar>
              > >> <weblogic-enterprise-bean>
              > >> <ejb-name>chargeMgr</ejb-name>
              > >> <jndi-name>chargeMgr</jndi-name>
              > >> <transaction-isolation>
              > >> <isolation-level>Serializable</isolation-level>
              > >> <method>
              > >> <ejb-name>chargeMgr</ejb-name>
              > >> <method-intf>Remote</method-intf>
              > >> <method-name>*</method-name>
              > >> </method>
              > >> </transaction-isolation>
              > >> </weblogic-enterprise-bean>
              > >> </weblogic-ejb-jar>
              > >>
              > >> I have checked the syntax against the weblogic documentation.
              > >> However, when i try to jar the beans up into the jar file
              (weblogic.ejbc),
              > >it
              > >> give me the following error :
              > >>
              > >> org.xml.sax.SAXParseException: Element "weblogic-enterprise-bean"
              allows
              > >no further
              > >> input; "transaction-isolation" is not allowed.
              > >>
              > >> Can anyone help?
              > >>
              > >> Regards.
              > >>
              > >
              > >
              >
              

  • Setting transaction isolation level in a session bean

    Hi all!
    In a stateless session bean (EJB3) with container managed transactions I need to set the transaction isolation level to SERIALIZABLE.
    The idea is to prevent lost update on database when multiple accesses occur concurrently.
    Thanks in advance for your patience,
    Tommaso

    Hi all!
    In a stateless session bean (EJB3) with container managed transactions I need to set the transaction isolation level to SERIALIZABLE.
    The idea is to prevent lost update on database when multiple accesses occur concurrently.
    Thanks in advance for your patience,
    Tommaso

  • Setting transaction isolation levels in WAS5

    I think I'm missing something pretty easy. How can I set the isolation
    levels for the containter managed transactions on my beans?
    Specifically, I want to set soem lookup methods on my Sessions beans
    to TRANSACTION_REPEATABLE_READ. I've already put the
    container-transaction blocks in my ejb-jar.xml
    Does Websphere 5 have something akin to WebLogic's
    weblogic-ejb-jar.xml where you can set additional parameters like
    this? Do I have to use a tool like WSAD to specify this? The AAT
    doesn't seem to have this option.
    Thanks,
    James Lynn

    Hi Slava, Ryan,
    We haven't looked at 8.1 yet since our release cycle wouldn't allow us
    to move to 8.1 until at least June anyway, but even if the problems was
    fixed there it took BEA support more than 6 months (I opened the case on
    Sep 23 2002 and only this week I got the patch that I haven't even tried
    to test to see if it works) to issue a patch for such a small problem.
    The server would just check if the Oracle XA driver was being used and
    no matter what version would just throw an exception if you try to set
    the transaction isolation level saying that the feature in the Oracle
    8.1.7 driver was broken... (although you might be using 9.x or even a
    pre-8.1.7 driver)...
    So this is about it.
    And Slava, I've tried pushing a case harder only to end up with BEA
    support trying to convince me that I was misinterpreting the JDBC spec
    when it was not true, so I just gave up. The main goal of BEA support in
    all of our experience has been that they don't try to solve the cases
    but close them.
    That's my and some of my colleagues personal views anyway, you don't
    have to share them.
    Regards,
    Dejan
    Slava Imeshev wrote:
    Hi Deyan,
    Sorry for the delay. Could you give us more details about CR090104?
    I've got some feedback in XA area, not sure if it was a related case.
    Also, I've never had any problems with weblogic CCE, so you may want
    to push your case a little harder.
    As per the bold statement - the initial question was about functionality
    available in weblogic but not available in websphere - it can't be more
    bold :)
    Regards,
    Slava Imeshev
    "Deyan D. Bektchiev" <[email protected]> wrote in message
    news:[email protected]...
    This is a very bold statement Slava, considering that with Oracle XA
    driver you cannot even set the transaction isolation level because of a
    Weblogic bug (CR090104 that has been open for more than 6 months
    already)...
    Dejan
    Slava Imeshev wrote:
    Hi James,
    "James F'jord Lynn" <[email protected]> wrote in message
    news:[email protected]...
    I think I'm missing something pretty easy. How can I set the isolation
    levels for the containter managed transactions on my beans?
    Specifically, I want to set soem lookup methods on my Sessions beans
    to TRANSACTION_REPEATABLE_READ. I've already put the
    container-transaction blocks in my ejb-jar.xml
    Does Websphere 5 have something akin to WebLogic's
    weblogic-ejb-jar.xml where you can set additional parameters like
    this? Do I have to use a tool like WSAD to specify this? The AAT
    doesn't seem to have this option.
    My guess here is that it's a signal that this is a last chance
    for you to abandon WebSphere and return back to WebLogic's
    safe harbor.
    Regards,
    Slava Imeshev

  • Setting transaction isolation level rises ORA-02089 error

    Hello
    We have configured a distributed transaction in our application server and
    we are using openjpa 1.2.1 and Glassfish application server and Oracle 11g as DB server. Although the default behavior of transaction locking must be optimistic,
    it seems that pessimistic locking has been happened.
    It is found that Row Lock contention happens in a specific table.
    This is the exception :
    java.sql.SQLException: ORA-02049: timeout: distributed transaction waiting for lock
    Already all the following properties have been set for openjpa.
    1. <persistence-unit name="JPXA" transation-type="JTA">
    2. <property name="openjpa.TransactionMode" value="managed"/>
    You can try a plug-in string to lookup the TM in JNDI (the value is the JNDI name of GlassFish TM as per Google search)
    3. <property name="openjpa.ManagedRuntime"
    value="jndi(TransactionManagerName=java:appserver/TransactionManager)"/>
    Following searching about this locking problem, we found that we should add two more properties for openjpa as listed below.
    <property name="openjpa.LockManager" value="version" />
    <property name="openjpa.jdbc.TransactionIsolation" value="read-committed" />
    but this time by setting the transaction isolation level, we have got another error: org.apache.openjpa.persistence.PersistenceException: ORA-02089: COMMIT is not allowed in a subordinate session.
    Thanks for any help.
    Regards,
    Sargol

    Hello
    We have configured a distributed transaction in our application server and
    we are using openjpa 1.2.1 and Glassfish application server and Oracle 11g as DB server. Although the default behavior of transaction locking must be optimistic,
    it seems that pessimistic locking has been happened.
    It is found that Row Lock contention happens in a specific table.
    This is the exception :
    java.sql.SQLException: ORA-02049: timeout: distributed transaction waiting for lock
    Already all the following properties have been set for openjpa.
    1. <persistence-unit name="JPXA" transation-type="JTA">
    2. <property name="openjpa.TransactionMode" value="managed"/>
    You can try a plug-in string to lookup the TM in JNDI (the value is the JNDI name of GlassFish TM as per Google search)
    3. <property name="openjpa.ManagedRuntime"
    value="jndi(TransactionManagerName=java:appserver/TransactionManager)"/>
    Following searching about this locking problem, we found that we should add two more properties for openjpa as listed below.
    <property name="openjpa.LockManager" value="version" />
    <property name="openjpa.jdbc.TransactionIsolation" value="read-committed" />
    but this time by setting the transaction isolation level, we have got another error: org.apache.openjpa.persistence.PersistenceException: ORA-02089: COMMIT is not allowed in a subordinate session.
    Thanks for any help.
    Regards,
    Sargol

  • Setting transaction isolation level for jDriver Oracle/XA

    edocs (http://e-docs.bea.com/wls/docs70/oracle/trxjdbcx.html#1080746) states that,
    if using jDriver for Oracle/XA you can not set the transaction isolation level
    for a
    transaction and that 'Transactions use the transaction isolation level set on
    the connection
    or the default transaction isolation level for the database'. Does this mean that
    you shouldn't try to set it programatically (fair enough) or that you can't set
    it in the weblogic deployment descriptor either? Also anybody got any idea what
    the default is likely to be if you are using
    an Oracle 9iR2 database?

    Ian,
    The default for Oracle (any version) is ReadCommitted. The only other
    isolation level Oracle supports is Serializable but it's implemented in
    such a way that you will be allowed to continue until commit time and
    only then you might get an exception stating the the access for that
    transaction could not be serialized.
    I don't know for the jDriver but if you use the Oracle Thin XA driver
    even if you set the isolation level in your descriptor you will get an
    exception from Weblogic. It is a Weblogic bug and you can contact
    [email protected] to get a patch.
    Regards,
    Dejan
    IJ wrote:
    edocs (http://e-docs.bea.com/wls/docs70/oracle/trxjdbcx.html#1080746) states that,
    if using jDriver for Oracle/XA you can not set the transaction isolation level
    for a
    transaction and that 'Transactions use the transaction isolation level set on
    the connection
    or the default transaction isolation level for the database'. Does this mean that
    you shouldn't try to set it programatically (fair enough) or that you can't set
    it in the weblogic deployment descriptor either? Also anybody got any idea what
    the default is likely to be if you are using
    an Oracle 9iR2 database?

  • Setting Transaction isolation level when I'm not in an EJB

              I have a Message Driven Bean (MDB) that is container managed, and its transaction
              isolation is set to TRANSACTION_READ_COMMITTED in weblogic-ejb-jar.xml and that
              seems to work fine. If I look at an entity bean in onMessage which is updated/commited
              outside the transaction I can see the updates no problem.
              Now the problem is this.. inside the onMessage method, the MDB creates a new
              instance of a class. This class starts up its own UserTransaction (using (UserTransaction)new
              InitialContext().lookup("javax.transaction.UserTransaction")) and goes into a
              loop working away. Inside the loop it is inspecting a value on an entity bean.
              The classs never sees any updates to this bean which are made outside this new
              UserTransaction.
              It looks to me that the UserTransaction that the class is getting has a different
              isolation level (serialized?). Is there a way to set the isolation level for
              a UserTransaction?
              Any help would be great!
              lance
              

              Just a follow up, I think the isolation level is perhaps being set to REPEATABLE_READ,
              since that is what seems to be happening. The value from the first read is maintained
              through subsequent reads in the same transaction.
              lance
              "Lance" <[email protected]> wrote:
              >
              >I have a Message Driven Bean (MDB) that is container managed, and its
              >transaction
              >isolation is set to TRANSACTION_READ_COMMITTED in weblogic-ejb-jar.xml
              >and that
              >seems to work fine. If I look at an entity bean in onMessage which is
              >updated/commited
              >outside the transaction I can see the updates no problem.
              >
              >Now the problem is this.. inside the onMessage method, the MDB creates
              >a new
              >instance of a class. This class starts up its own UserTransaction (using
              >(UserTransaction)new
              >InitialContext().lookup("javax.transaction.UserTransaction")) and goes
              >into a
              >loop working away. Inside the loop it is inspecting a value on an entity
              >bean.
              > The classs never sees any updates to this bean which are made outside
              >this new
              >UserTransaction.
              >
              >It looks to me that the UserTransaction that the class is getting has
              >a different
              >isolation level (serialized?). Is there a way to set the isolation level
              >for
              >a UserTransaction?
              >
              >Any help would be great!
              >
              >lance
              

  • How to set Transaction isolation level in Weblogic 11g

    How do I set the transaction isolation level in Weblogic?
    Some references that I found suggest that I have to explicitely state the isolation level in the weblogic-ejb-jar.xml per ejb. If I am using EJB 3.0 why would I need to do that?
    Can I set this up as a property in the JDBC datasource setup?
    Other application servers like Websphere actually allows for this. Can this be done in Weblogic?
    Currently I get the following message if I don't set the isolation level:
    Transaction attribute: TX_NOT_SUPPORTED Isolation Level: No Isolation Level Set Tx Timeout: 30000
    What seems to be happening is that one update of my transaction is getting rolled back and other consequent calls are failing due to foreign key issues due to the first rollback.
    I think the issue is related to the isolation level or the transaction time out being too low.
    Any ideas?
    BTW: I am using openjpa and using a MS SQLServer. Not sure if that helps the discussion.
    Thanks
    Edited by: rrivera on Jun 2, 2010 9:18 AM

    How do I set the transaction isolation level in Weblogic?
    Some references that I found suggest that I have to explicitely state the isolation level in the weblogic-ejb-jar.xml per ejb. If I am using EJB 3.0 why would I need to do that?
    Can I set this up as a property in the JDBC datasource setup?
    Other application servers like Websphere actually allows for this. Can this be done in Weblogic?
    Currently I get the following message if I don't set the isolation level:
    Transaction attribute: TX_NOT_SUPPORTED Isolation Level: No Isolation Level Set Tx Timeout: 30000
    What seems to be happening is that one update of my transaction is getting rolled back and other consequent calls are failing due to foreign key issues due to the first rollback.
    I think the issue is related to the isolation level or the transaction time out being too low.
    Any ideas?
    BTW: I am using openjpa and using a MS SQLServer. Not sure if that helps the discussion.
    Thanks
    Edited by: rrivera on Jun 2, 2010 9:18 AM

  • Why encounter errors while setting transaction isolation level?

    When attempting to set the transaction isolation level within an EJB, I encountered the following exception from the server log:
    ===========================================================
    [#|2006-05-30T15:08:45.906+0800|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=25;|
    Enter ejbCreate( 100, Duke, Earl, 0.00 ):|#]
    [#|2006-05-30T15:08:45.937+0800|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=25;|
    List of Supported Transaction Isolation Levels: |#]
    [#|2006-05-30T15:08:45.937+0800|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=25;|
    TRANSACTION_READ_UNCOMMITTED is supported!|#]
    [#|2006-05-30T15:08:45.937+0800|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=25;|
    TRANSACTION_READ_COMMITTED is supported!|#]
    [#|2006-05-30T15:08:45.937+0800|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=25;|
    TRANSACTION_REPEATABLE_READ is supported!|#]
    [#|2006-05-30T15:08:45.937+0800|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=25;|
    TRANSACTION_SERIALIZABLE is supported!|#]
    [#|2006-05-30T15:08:45.937+0800|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=25;|
    1. |#]
    [#|2006-05-30T15:08:45.937+0800|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=25;|Transaction Status: |#]
    [#|2006-05-30T15:08:45.937+0800|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=25;|TRANSACTION_READ_COMMITTED|#]
    [#|2006-05-30T15:08:45.937+0800|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=25;|
    con.isReadOnly() = false|#]
    [#|2006-05-30T15:08:45.937+0800|WARNING|sun-appserver-pe8.1_02|javax.enterprise.system.stream.err|_ThreadID=25;|
    SQLException: java.sql.SQLException: Transaction manager errors. statement not allowed in XA session.|#]
    [#|2006-05-30T15:08:45.937+0800|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.container.ejb|_ThreadID=25;|EJB5018: An exception was thrown during an ejb invocation on [SavingsAccountBean]|#]
    [#|2006-05-30T15:08:45.937+0800|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.container.ejb|_ThreadID=25;|
    javax.ejb.EJBException: ejbCreate: Unable to connect to database. Transaction manager errors. statement not allowed in XA session.
    at SavingsAccountBean.ejbCreate(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:950)
    at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:158)
    at com.sun.ejb.containers.EJBHomeInvocationHandler.invoke(EJBHomeInvocationHandler.java:170)
    at $Proxy60.create(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:123)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:648)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:192)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1709)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1569)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:951)
    at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:181)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:721)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:469)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1258)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:409)
    |#]===========================================================
    But from the above log messages, all transcation isolation levels are supported. The relevant source codes are:
    /*********************** Database Routines *************************/
    private void makeConnection() {
    try {
    InitialContext ic = new InitialContext();
    DataSource ds = ( DataSource )ic.lookup( dbName );
    con = ds.getConnection();
    DatabaseMetaData dmd = con.getMetaData();
    show_supported_trans_levels( dmd );
    int status = con.getTransactionIsolation();
    System.out.print( "1. " );
    disp_tx_status( status );
    System.out.println( "con.isReadOnly() = " + con.isReadOnly() );
    con.setTransactionIsolation( Connection.TRANSACTION_SERIALIZABLE );
    System.out.print( "2. " );
    disp_tx_status( status );
    } catch( SQLException ex ) {
    System.err.println( "SQLException: " + ex.toString() );
    throw new EJBException("Unable to connect to database. " +
    ex.getMessage());
    } catch( NamingException ex ) {
    System.err.println( "NamingException: " + ex.toString() );
    throw new EJBException("Unable to connect to database. " +
    ex.getMessage());
    private void disp_tx_status( int status )
    System.out.print( "Transaction Status: " );
    switch( status )
    case( Connection.TRANSACTION_READ_UNCOMMITTED ):
    System.out.println( "TRANSACTION_READ_UNCOMMITTED" );
    break;
    case( Connection.TRANSACTION_READ_COMMITTED ):
    System.out.println( "TRANSACTION_READ_COMMITTED" );
    break;
    case( Connection.TRANSACTION_REPEATABLE_READ ):
    System.out.println( "TRANSACTION_REPEATABLE_READ" );
    break;
    case( Connection.TRANSACTION_SERIALIZABLE ):
    System.out.println( "TRANSACTION_SERIALIZABLE" );
    break;
    case( Connection.TRANSACTION_NONE ):
    System.out.println( "TRANSACTION_NONE" );
    break;
    default:
    System.out.println( "UNKNOWN" );
    break;
    Who can help me?

    Try the following forum (about EJB technology)
    http://forum.java.sun.com/forum.jspa?forumID=13

  • Transaction Isolation Levels

    Hi Everyboody.
    Oracle docs. say that Oracle supports three isolation levels and the isolation level should be set before the transaction begins with the SET TRANSACTION ISOLATION LEVEL .....
    Resource: http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a96524/c21cnsis.htm#2641
    But I find that Oracle 9i supports only two isolation levels, viz. Read Committed and Serializable.
    SQL> SET TRANSACTION ISOLATION LEVEL READ ONLY
    2 ;
    SET TRANSACTION ISOLATION LEVEL READ ONLY
    ERROR at line 1:
    ORA-02179: valid options: ISOLATION LEVEL { SERIALIZABLE | READ COMMITTED }
    Is READ ONLY isolatin level avalilable in Oracle 9i or is there any problem with my SET instruction?
    Please help me at the earliest.
    Have a nice day!
    Kishore

    Thanks Dmitry.
    It works.
    Continuing on the same thread, I would like to know what is the difference between READ COMMITTED and SERIALIZABLE isolation levels?
    Thank you for your reply.
    Kishore.

  • Regarding Transaction Isolation Level

    We talk about query and update constent problem again. even I don't take it as problem.
    I can see this in SAP notes or SAP help:
    JDBC Sender Adapter...
    ·        The UPDATE statement must alter exactly those data records that have been selected by the SELECT statement. You can ensure this is the case by using an identical WHERE clause. (See Processing Parameters, SQL Statement for Query, and SQL Statement for Update below).
    ·        Processing can only be performed correctly when the Transaction Isolation Level is set to repeatable_read or serializable.
    If I set transaction isolation level as default, then how can I make sure ' default' is repeatable_read or serializable?
    Our DB is Informix.

    Hey
    Please go through the below blog and see if it helps
    /people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter
    Thanks
    Aamir

  • Concurrent transaction isolation

    Hello,
    I am building a multithreaded application that uses the Semantic Jena APIs that relies on the transactions of the different threads to be isolated before a commit but I'm not quite getting this behavior. Here's a simple example (the full example source is available upon request).
    <h1>Thread 1</h1>
    Open a connection
    Get a GraphOracleSem from the connection
    call GraphOracleSem.getTransactionHandler.begin()
    Add Triple A
    Add Triple B
    Add Triple C
    call GraphOracleSem.getTransactionHandler.commit()
    Close the GraphOracleSem
    Dispose the connection
    Open a connection
    Get a GraphOracleSem from the connection
    call GraphOracleSem.getTransactionHandler.begin()
    Add Triple A
    Add Triple B
    Add Triple C
    call GraphOracleSem.getTransactionHandler.commit()
    Close the GraphOracleSem
    Dispose the connection
    <h1>Thread 2</h1>
    Open a connection
    Get a GraphOracleSem from the connection
    call GraphOracleSem.getTransactionHandler.begin()
    CheckA = true if Triple A Exists
    CheckB = true if Triple B Exists
    CheckC = true if Triple C Exists
    Throw Exception unless CheckA == CheckB == CheckC
    call GraphOracleSem.getTransactionHandler.abort() //no write is necessary here
    Close the GraphOracleSem
    Dispose the connection
    Now if the effects of the two threads were isolated from each other, CheckA and CheckB and CheckC would always be equivalent (sometimes, true, sometimes false) but this does not seem to be the case (when my code at least...). I'm not sure if this requires a Serializeable transaction isolation level to be specified but quoting the GraphOracleSem performAdd method:
    <h4>"Adds a triple into the graph. This change to this graph object will not be persisted until the transaction is committed. However, subsequent queries (using the same Oracle connection) can see this change."</h4>
    Doesn't this mean that two connections making changes to GraphOracleSem should not see each-other's changes until a commit? Or is there something I'm missing here?
    Also if this isn't the way to get something like this to work, how can it be done?
    Edited by: alexi on Nov 11, 2010 12:22 PM - Whoops, cant attach anything to this forum

    Hi,
    I am afraid you cannot use it this way.
    See this example using SQL inserts directly. Assume there are two concurrent sessions.
    Session 1:
    SQL> set transaction isolation level serializable;
    Transaction set.
    SQL> insert into basic_tpl values(sdo_rdf_triple_s('basic','<urn:a>','<urn:b>','<urn:c_123>'));
    1 row created.
    Session 2:
    SQL> set transaction isolation level serializable;
    Transaction set.
    SQL> insert into basic_tpl values(sdo_rdf_triple_s('basic','<urn:a>','<urn:b>','<urn:c_567>'));
    insert into basic_tpl values(sdo_rdf_triple_s('basic','<urn:a>','<urn:b>','<urn:c_567>'))
    ERROR at line 1:
    ORA-08177: can't serialize access for this transaction
    ORA-06512: at "MDSYS.SDO_RDF_INTERNAL", line 7538
    ORA-06512: at "MDSYS.BASIC_INS", line 37
    ORA-04088: error during execution of trigger 'MDSYS.BASIC_INS'
    SQL> rollback;
    Rollback complete.
    SQL> insert into basic_tpl values(sdo_rdf_triple_s('basic','<urn:a>','<urn:b>','<urn:c_567>'));
    insert into basic_tpl values(sdo_rdf_triple_s('basic','<urn:a>','<urn:b>','<urn:c_567>'))
    ERROR at line 1:
    ORA-55303: SDO_RDF_TRIPLE_S constructor failed: BNode-non-reuse case:
    SQLERRM=ORA-06519: active autonomous transaction detected and rolled back
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 17
    ORA-06512: at "MDSYS.SDO_RDF_TRIPLE_S", line 64
    If you want application level serialization, you can use dbms_lock package to acquire a lock before
    performing updates. Another simple way is to create a simple table with one row and do a "select * from tabName for update." You can add a "nowait" if you don't want your session to be blocked.
    Hope it helps,
    Zhe Wu

Maybe you are looking for

  • Receiving a false paper jam error message for a 6310 all in one printer

    I have an hp 6310 all in one printer.  It is showing a false paper jam error message with no paper in the printer.  I have tried all  of the fixes that have been suggested on the website as well as on you tube to no avail.  Nothing works, I have clea

  • RE: Can you help me - Please?

    Gary, I haven't taken one of his training classes, but he does post mail to the Forte Users Group frequently. Here is an e-mail address for Stephen McHenry. Stephen McHenry [SMTP:[email protected]] The Forte Users Group has a searchable archive threa

  • CR 2008 report not displaying until Group Tree clicked

    We are having an issue with our CR 2008 web based reports.  The reports run correctly locally, but not when launched from a Windows 2008 Server on which we installed Crystal Reports 2008 Fix Pack 3.3 - Redist Install.  This is a web based application

  • Line Graph and BarChart

    can any one give me idea that how to dispay the data in line grph and bar chart..... I need to retrieve my data from database and then display in line graph or bar chart.... can any one teach me or guide me..... Thanks....

  • Change in Ship To Party

    How to change the ship to party when PO raised and sent to vendor in the 3rd party sales? Edited by: Lakshmipathi on Aug 28, 2011 8:05 AM Please use the subject effectively