No JDBC connection can be made (transaction state is Committing)

 

Hi. This seems to be a case where your EJB transaction has obtained a jts
JDBC connection, but done no JDBC at all by the time the transaction is committing.
Is this possible? Nevertheless our EJB code is calling commit on on the jts
connection. Any first JDBC call on a jts connection is the one which actually
obtains the underlying pool connection, but this is being disallowed because
the tx is already being committed. I remember this being fixed a while ago,
so this may be a regression. Do file an official tech support case. Meanwhile,
I'll look into it.
Joe
Chetan Desai wrote:
>
Even we get these messages after a while the WL server is up and running. We are
using ver.6.1
Any help/suggestions?
-Chetan.
Joseph Weinstein <[email protected]> wrote:
Hi Roman. What version of our product are you using?
Joe
Roman Puttkammer wrote:
after some (presumably unrelated?) code changes, the weblogic server
seems to be
unable to open a connection to the database while calling an EJB method.
Even though
previously established connections already exist.
The exact error message text is
java.sql.SQLException: No JDBC connection can be made because the
transaction
state is Committing
The complete stack trace follows below. Does anybody have an idea what
we're
doing wrong?
any help is appreciated!
roman
java.sql.SQLException: No JDBC connection can be made because the
transaction state is Committing
at
weblogic.jdbcbase.jts.Connection.openConnectionIfNecessary(Connection.java:536)
at weblogic.jdbcbase.jts.Connection.commit(Connection.java:465)
at
weblogic.jdbcbase.jts.TxConnection.commitOnePhase(TxConnection.java:53)
at
weblogic.jts.internal.CoordinatorImpl.commitSecondPhase(CoordinatorImpl.java:403)
at
weblogic.jts.internal.CoordinatorImpl.commit(CoordinatorImpl.java:306)
at weblogic.jts.internal.TxContext.commit(TxContext.java:228)
at
weblogic.ejb.internal.StatefulEJBObject.postInvokeOurTx(StatefulEJBObject.java:204)
at
weblogic.ejb.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:285)
at
com.multex.EJB.security.ListedSecurityEJBEOImpl.getSecurityTypeCode(ListedSecurityEJBEOImpl.java:198)
at
com.multex.EJB.security.FinancialInstrumentFacade.getSecurityTypeCode(FinancialInstrumentFacade.java:88)
at
com.multex.beans.security.FinancialInstrumentFunctorBuilder.createFinancialInstrumentFunctor(FinancialInstrumentFunctorBuilder.ja
va:43)
at
com.multex.beans.security.FinancialInstrumentFunctorBuilder.createFinancialInstrumentFunctor(FinancialInstrumentFunctorBuilder.ja
va:73)
at
com.multex.beans.portfolio.HoldingFunctorBuilder.createHoldingFunctor(HoldingFunctorBuilder.java:86)
at
com.multex.beans.portfolio.HoldingFunctorBuilder.createHoldingFunctors(HoldingFunctorBuilder.java:140)
at
com.multex.beans.portfolio.AccountFunctorBuilder.setUpHoldingFunctors(AccountFunctorBuilder.java:46)
at
com.multex.beans.portfolio.AccountFunctorBuilder.createAccountFunctor(AccountFunctorBuilder.java:67)
at
com.multex.beans.portfolio.AccountFunctorBuilder.createAccountFunctors(AccountFunctorBuilder.java:93)
at
com.multex.beans.portfolio.PortfolioFunctorBuilder.setUpAccountFunctors(PortfolioFunctorBuilder.java:78)
at
com.multex.beans.portfolio.PortfolioFunctorBuilder.createPortfolioFunctor(PortfolioFunctorBuilder.java:100)
at
com.multex.beans.portfolio.PortfolioFunctorBuilder.createPortfolioFunctors(PortfolioFunctorBuilder.java:61)
at
com.multex.beans.portfolio.PortfolioUserFunctorBuilder.createPortfolioUserFunctor(PortfolioUserFunctorBuilder.java:90)
at
com.multex.beans.portfolio.PortfolioApp.createPortfolioUserFunctor(PortfolioApp.java:208)
at
com.multex.beans.portfolio.PortfolioApp.setUserId(PortfolioApp.java:41)
at
com.multex.beans.portfolio.MinPortfolioApp.setUserId(MinPortfolioApp.java:94)
at
com.multex.beans.session.UserSession.init(UserSession.java:168)
at
com.multex.beans.session.UserSession.<init>(UserSession.java:51)
at
com.multex.EJB.session.UserSessionEJB.createSession(UserSessionEJB.java:226)
at
com.multex.EJB.session.UserSessionEJB.ejbLoad(UserSessionEJB.java:157)
at
weblogic.ejb.internal.EntityEJBContext.load(EntityEJBContext.java:130)
at
weblogic.ejb.internal.EntityEJBContext.afterBegin(EntityEJBContext.java:165)
at
weblogic.ejb.internal.StatefulEJBObject.getContextForInvoke(StatefulEJBObject.java:115)
at
weblogic.ejb.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:174)
at
com.multex.EJB.session.UserSessionEJBEOImpl.isNew(UserSessionEJBEOImpl.java:196)
at
com.multex.EJB.session.UserSessionFacadeEJB.isNew(UserSessionFacadeEJB.java:128)
at com.multex.servlets.session.Servlet.doGet(Servlet.java:158)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:715)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:75)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:286)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:238)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:501)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:260)
at weblogic.t3.srvr.ExecuteThread.run(ExecuteThread.java:106)--
The Weblogic Application Server from BEA
JavaWorld Editor's Choice Award: Best Web Application Server
Java Developer's Journal Editor's Choice Award: Best Web Application
Server
Crossroads A-List Award: Rapid Application Development Tools for
Java
Intelligent Enterprise RealWare: Best Application Using a Component Architecture
http://weblogic.beasys.com/press/awards/index.htm

Similar Messages

  • Errors using weblogic sql driver: "No JDBC connection can be made because the transaction state is marked rollback"

    One of our customers starts to encounter this error message recently.
    We checked our log files. It seems that the error happens when
    to obtain a jdbc connection. Have anyone seen similar problems
    and knows how to fix it? thanks in advance.
    We are using weblogic server 6.1sp2, and weblogic sql type 4 driver.
    The functions that invoke the jdbc calls are stateless session bean
    methods with their transaction attributes marked as Required.
    There is no nested calls of these methods.
    A partial stack trace we obtained is as following:
    java.sql.SQLException: No JDBC connection can be made
    because the transaction state is
    Marked Rollback
         at weblogic.jdbc.jts.Connection.getOrCreateConnection(Connection.java:586)
         at weblogic.jdbc.jts.Connection.prepareStatement(Connection.java:115)
         at weblogic.jdbc.rmi.internal.ConnectionImpl.prepareStatement(ConnectionImpl.java:135)
         at weblogic.jdbc.rmi.SerialConnection.prepareStatement(SerialConnection.java:76)
    lixin

    Joseph Weinstein <[email protected]> wrote:
    >
    >
    YuanHui Liu wrote:
    Joe,
    We got the exact same error message. The error came after we got theJDBC connection,
    and trying to create statement off it.
    It occurs intermitently when we are running another standalone JAVAapp to do
    some end of day work, which results in the DB Server being very busy(90+%CPU
    usage) for about 5 minutes. We see a surge of requests to the WLSJDBC Connection
    pool. This would sometimes result in all our subsequent DB requeststo fail and
    lead to a crash.
    We are using WLS6.0SP1. I do not think there's a 30 seconds wait leadingto a
    connection timeout that caused this(rather it is the end effect).
    Can you give us a more detailed explanation? Is there a miscommunicationbetween
    our DB(Sybase12) and WLS?Hi. It looks to you like it's after you get the connection, but really
    it's when the server is
    gettng the pool connection. For performance/synchronization reasons we
    do a clever
    delay: When your code asks for a pool connection we quickly give you
    the pool wrapper,
    but we delay actually reserving the real underlying DBMS connection until
    your first
    real need for a connection, at your first JDBC call, such as createStatement()
    etc.
    It is while waiting for a pool connection long enough for the transaction
    coordinator
    to have timed you out before you ever get a chance. It's nothing to do
    with the
    DBMS or even JDBC, I believe. I think the weblogic server either has
    too few execute-threads
    and/or too few CPU cycles to do the work load.
    Okay, so there's a lazy initialization of the connection.
    From reading our log I believe our failur is immediate rather
    than waiting for 30+ seconds(the default setting) from the DB,
    the timeout occurred later as a result. At the time either because the DB Server
    is very busy.
    Since we are running WLS6.0 we have only one connection pool,
    we have defined a max of 150 threads in the pool. While this
    is happening the DB Server is being pinned by an overnight job,
    but the WLS Server is not busy at all. The DB and WLS resides
    on different physical boxes.
    We also have a thread dump from the WLS console when we rebooted the server, it
    showed that we are hanging on to the thread & jdbc
    connections after these exceptions has occurred instead of releasing them, note
    "16083"(~4.5 hours) seconds has passed:
    142 116222 Retry rollback request for tx: 'transaction=(IdHash=2963855,Name =
    [EJB UserManagerBeanImpl.signalICUserServletHeartBeat()],Xid=30643:8f3838f3709bf53d,Status=Rolling
    Back. [Reason = Unknown],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since
    begin=16083,seconds left=10,ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=started,assigned=server),SCInfo[server]=(state=active),properties=({weblogic.jdbc=t3://159.55.158.25:8005,
    weblogic.transaction.name=[EJB UserManagerBeanImpl.signalICUserServletHeartBeat()]}))'
    Scheduled Trigger
    So I would argue this problem actually chewed up resources on the WLS server.
    -Yuanhui Liu
    >>
    >>
    Thanks.
    -YuanHui Liu
    Joseph Weinstein <[email protected]> wrote:
    lixin wrote:
    One of our customers starts to encounter this error message recently.
    We checked our log files. It seems that the error happens when
    to obtain a jdbc connection. Have anyone seen similar problems
    and knows how to fix it? thanks in advance.
    We are using weblogic server 6.1sp2, and weblogic sql type 4 driver.
    The functions that invoke the jdbc calls are stateless session bean
    methods with their transaction attributes marked as Required.
    There is no nested calls of these methods.
    A partial stack trace we obtained is as following:
    java.sql.SQLException: No JDBC connection can be made
    because the transaction state is
    Marked Rollback
    at weblogic.jdbc.jts.Connection.getOrCreateConnection(Connection.java:586)Hi. This sounds like a JVM thread starvation issue, and/or a server
    load
    issue. What is
    happening is that the transaction is started, and times out beforethe
    SSB even gets to
    the first JDBC work. I would first verify that the customer is using
    the very latest JVM
    available for the machine.
    Joe Weinstein
    at weblogic.jdbc.jts.Connection.prepareStatement(Connection.java:115)
    at weblogic.jdbc.rmi.internal.ConnectionImpl.prepareStatement(ConnectionImpl.java:135)
    at weblogic.jdbc.rmi.SerialConnection.prepareStatement(SerialConnection.java:76)
    lixin

  • Caused by java.sql.SQLException: No JDBC connection can be made

    Hi,
    I am using OSB11g (with soa db adapter ) to select data from DB2 Database. I am trying to just fetch like 100 records(very less).
    I get this Exception once in 4-5 tests I do . I am not sure if I have to modify any configurations, in case its timing out .
    I see something like *"To classify it as non-retriable instead add property nonRetriableErrorCodes with value "0" to your deployment descriptor (i.e. weblogic-ra.xml)."*
    I don't see the tables when I try to perform SELECT operation in db adapter. In JDev worksheet I can see the tables and records when queried.
    BEA-380002: Invoke JCA outbound service failed with connection error, exception: com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/SampleOSBEMEA/WSDL/DBOut [ DBOut_ptt::DBOut(DBOutInput_msg,DBOutOutputCollection) ] - WSIF JCA Execute of operation 'DBOut' failed due to: Pure SQL Exception.
    Pure SQL Execute of SELECT Column1, Column2 ..........Column216 from Table.
    Caused by java.sql.SQLException: No JDBC connection can be made
    because the transaction state is
    Rolledback.
    ; nested exception is:
    BINDING.JCA-11633
    Pure SQL Exception.
    Caused by java.sql.SQLException: No JDBC connection can be made
    because the transaction state is
    Rolledback.
    The Pure SQL option is for border use cases only and provides simple yet minimal functionality. Possibly try the "Perform an operation on a table" option instead. This exception is considered retriable, likely due to a communication failure. Because the global transaction is rolling back the invoke must be retried in a new transaction, restarting from the place of the last transaction commit. To classify it as non-retriable instead add property nonRetriableErrorCodes with value "0" to your deployment descriptor (i.e. weblogic-ra.xml).
    The Pure SQL option is for border use cases only and provides simple yet minimal functionality. Possibly try the "Perform an operation on a table" option instead. This exception is considered retriable, likely due to a communication failure. Because the global transaction is rolling back the invoke must be retried in a new transaction, restarting from the place of the last transaction commit. To classify it as non-retriable instead add property nonRetriableErrorCodes with value "0" to your deployment descriptor (i.e. weblogic-ra.xml).
    at oracle.tip.adapter.db.exceptions.DBResourceException.createXARetriableException(DBResourceException.java:670)
    at oracle.tip.adapter.db.exceptions.DBResourceException.createEISException(DBResourceException.java:642)
    at oracle.tip.adapter.db.exceptions.DBResourceException.pureSQLException(DBResourceException.java:711)
    at oracle.tip.adapter.db.puresql.PureSQLInteraction.executePureSQL(PureSQLInteraction.java:625)
    at oracle.tip.adapter.db.DBInteraction.executePureSQL(DBInteraction.java:1146)
    at oracle.tip.adapter.db.DBInteraction.execute(DBInteraction.java:254)
    at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.performOperation(WSIFOperation_JCA.java:529)
    ... 63 more
    Caused by: java.sql.SQLException: No JDBC connection can be made
    because the transaction state is
    Rolledback
    at weblogic.jdbc.jts.Driver.newConnection(Driver.java:949)
    at weblogic.jdbc.jts.Driver.createLocalConnection(Driver.java:327)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:173)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:364)
    at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:126)
    at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:94)
    at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
    at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.connectInternal(DatasourceAccessor.java:327)
    at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.connectInternal(DatabaseAccessor.java:291)
    at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.reconnect(DatasourceAccessor.java:558)
    at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.reconnect(DatabaseAccessor.java:1433)
    at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.incrementCallCount(DatasourceAccessor.java:302)
    at oracle.tip.adapter.db.DBConnection.getTopLinkSQLConnection(DBConnection.java:333)
    at oracle.tip.adapter.db.transaction.DBTransaction.beginInternal(DBTransaction.java:126)
    at oracle.tip.adapter.db.puresql.PureSQLInteraction.executePureSQL(PureSQLInteraction.java:171)
    ... 66 more
    Should I increase the time interval in weblogicra.xml (DEV/wls1034/middleware/Oracle_OSB1/lib/external/adapters/META-INF)
    for <wls:connection-reserve-timeout-seconds>5</wls:connection-reserve-timeout-seconds>
    Thanks
    Edited by: soauser on Jul 6, 2011 10:02 AM

    Looks like either database is too slow or data-source is not functioning properly. Make sure to test data source and see if it is in running state and it has sufficient number of connections (you may increase max connections value). Actually transaction is getting rolled back because it could not get connection in specified time period (may be JTA/statement timeout).
    Cross post in Weblogic JDBC forum as well for expert's advice -
    WebLogic Server - JDBC
    You may consider raising a case with support as well.
    Regards,
    Anuj

  • TS1474 itunes tells me "iphone wont sync as no connection can be made"

    I am trying to sync my iphone with my laptop PC and it syncs most things, except my contacts. My setting on itune are to sync "over the air" but it does not seem to do this. When i click the sync on itunes, it starts to sync but the a error box appears and states:
    "Itunes could not sync this information to this Iphone "Steve's Iphone" because a connection could not be established to the Iphone".
    Can anyone help how i can fix this issue as its driving me nuts?

    Hello Steve,
    Thank you for providing so much information about the syncing issue you are experiencing with your iPhone.  I recommend following the steps in this article to resolve an issue like this:
    iTunes 10.5 and later: Troubleshooting iTunes Wi-Fi Syncing
    http://support.apple.com/kb/ts4062
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • UI Shell template - jdbc connections

    We are using UI shell for our app so we could open mutliple tabs in the application, each tab opens a bounded Task flow with "Always Begin new Transaction" and "No Share Data Control". We limit total no of tabs that a user can be open to 10.
    The problem is because of "Always Begin new Transaction" the data Control (Frame) is holding a DB connection for each tab, so potentailly each user can user or an AM instance can hold up to 10 DB connections.
    My question is , IS there away to release DB connection of Data Control (Frame) when the TAB is not active and DB connection for the TAB this currently active, so we can limit the no of DB connections for the app?
    Thanks
    Ramesh

    Hi Ramesh
    Your conclusions here on why your app is taking is taking out 10 connections is nearly right, but it's the isolated data control scope that causes this, not the Always Begin New Transaction option. Please consult the paper "ADF Task Flow Transaction Fundamentals" and the 3 relating demos on the ADF Architecture Square to get a solid understanding of this:
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/adfarchitect-1639592.html
    Those options alone don't control that the connections will be pinned to a particular user session. You'll be familiar that ADF BC Application Module pool parameter control how the AMs activate/passivate, connect to the database and so on. One option to pay attention to is the jbo.doconnectionpooling option (which is false by default).
    This poorly named options would be better named "Disconnect Application Module Upon Release". What it does when false:
    * AM will attempt to hang onto JDBC connection when finished working with request
    * JDBC connection can keep open prepared statements over check in/out from pool
    * If AM is given to new user, rollback called to clear state + AM prepareSession()
    * Faster performance for users assuming they get served same AM
    * But limits scalability, connections are pinned to AM
    What it does when true:
    * AM will drop JDBC connections on completion of request
    * Increases scalability, connections can be reused
    * Forces activation/passivation for every request
    * AM prepareSession() called every new request
    * User performance is slower as prepared statements aren’t cached
    As such you might want to consider setting this to true.
    Regards,
    CM.

  • Two jdbc connections in one transaction

    Hi<br>
              <br>
              In a method of a container managed ejb session bean I have two jdbc connections. I've expected, that they will be in the same transaction, so results of any actions performed with first connection will be visible for the second connection, but it is not. <br>
              I've checked, that there are two sessions at the database, so it seams that there are simply separate transactions. Is it a problem with a ejb-jar.xml (will paste it later), datasource (driver - Oracle Thin non-XA; 1PC selected) or such behaviour can not be achieved in WLS ? <BR>
              <BR>
              regards
              <br>
              <BR><?xml version="1.0" encoding="UTF-8"?>
              <BR>
              <BR><!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
              <BR>
              <BR><ejb-jar >
              <BR>
              <BR>     <description><![CDATA[No Description.]]></description>
              <BR>     <display-name>ConnectionTest1</display-name>
              <BR>     
              <BR>     <enterprise-beans>
              <BR>          <session >
              <BR>               <description><![CDATA[]]></description>
              <BR>               
              <BR>               <ejb-name>ConnectionTest1</ejb-name>
              <BR>               
              <BR>               <home>pl.axit.test.ConnectionTest1Home</home>
              <BR>               <remote>pl.axit.test.ConnectionTest1</remote>
              <BR>     <ejb-class>pl.axit.test.ConnectionTest1Bean</ejb-class>
              <BR>     <session-type>Stateless</session-type>
              <BR>     <transaction-type>Container</transaction-type>
              <BR>     
              <BR>     <resource-ref >
              <BR>          <res-ref-name>jdbc/wowrite</res-ref-name>
              <BR>          <res-type>javax.sql.DataSource</res-type>
              <BR>          <res-auth>Container</res-auth>
              <BR>     </resource-ref>
              <BR>     </session>
              <BR>     </enterprise-beans>     
              <BR>     
              <BR>     <assembly-descriptor>
              <BR>          <container-transaction>
              <BR>               <description/>
              <BR>               <method>
              <BR>                    <description/>
              <BR>                    <ejb-name>ConnectionTest1</ejb-name>
              <BR>                    <method-name>*</method-name>
              <BR>               </method>
              <BR>               <trans-attribute>Required</trans-attribute>
              <BR>          </container-transaction>          
              <BR>
              <BR>     </assembly-descriptor>
              <BR></ejb-jar>

    Hi,
              are you using XA transactions? Two separate JDBC Connections treated
              within one transactional context will require two phase commit (via
              Emulation or an XA database driver) Please check the connections
              settings within your datasources.
              Rgds,
              Axel van Lil (LMIS.de)
              Lukas Uruski schrieb:
              > I forgot to add, that in administration console in server_name > Monitoring > JTA parameter "Transactions Total Count" increases by one each time method from previous post is invoked.

  • I don't get up-to-date data from mySQL with my JDBC connections

    Hi all,
    I have developped a server that uses 2 JDBC connections to mySQL. Those two connections are used by two different threads. Those connections are never closed. I just create a new Statement each time I want to make a query or an update, and commit after each update.
    1) If I modify data on my mySQL database with the first connection (UPDATE or DELETE), then my second connection doesn't see the modifications (using SELECT).
    2) And, if I use a different software to access my database on mySQL and make some modifications, my java application doesn't see the modifications in the database.
    In the two cases, my java application only see the changes in the mySQL database if I close the java application and launch it again.
    It's just like if a JDBC connection can see the modifications of the database it has itself made, but can't see modifications made by an other connection to the database... That sounds crazy, as most servers use connection pooling... What do I make wrong? Would you have any idea?
    Many thanks !

    Thank you for your answer.
    But no, it isn't a commit problem. I use InnoDB bases of mySQL, I use transactions, and I call the commit() method.
    For you or anybody to be able to try, I wrote some code. It creates 2 threads. The first thread write on DB and the other reads.
    package Tests;
    import java.sql.*;
    public class SQLConnections {
        private Thread internalThread1;   
        private Thread internalThread2;
        private Connection connection1;
        private Connection connection2;
        private static String driver = "org.gjt.mm.mysql.Driver";
        private static String database = "jdbc:mysql://223.186.6.12/test";
        private static String databaseLogin = "user";
        private static String databasePassword = "password";
        public SQLConnections() {
            // The thread that writes the SGBDR
            Runnable runner = new Runnable() {
                public void run() {
                    try {
                        // Launch the JDBC connection to the mySQL server.
                        Class.forName(driver).newInstance();
                        connection1 = DriverManager.getConnection (database, databaseLogin, databasePassword);
                        connection1.setAutoCommit(false);
                        synchronized ( internalThread1 ) {
                            internalThread1.sleep(10000);
                        while ( true ) {
                            Statement statement = connection1.createStatement();
                            statement.executeUpdate("INSERT INTO bike(color) VALUES('uniqueColor')");
                            connection1.commit();
                            System.out.println("                          ##### NEW LINE IN DB #####");
                            synchronized ( internalThread1 ) {
                                internalThread1.sleep(10000);
                    catch (Exception e) {
                        e.printStackTrace();
            internalThread1 = new Thread(runner);
            runner = null;
            internalThread1.setPriority(Thread.NORM_PRIORITY);
            internalThread1.start();
            // The thread that reads the SGBDR.
            runner = new Runnable() {
                public void run() {
                    try {
                        // Launch the JDBC connection to the mySQL server.
                        Class.forName(driver).newInstance();
                        connection2 = DriverManager.getConnection (database, databaseLogin, databasePassword);
                        connection2.setAutoCommit(false);
                        while ( true ) {
                            Statement statement = connection2.createStatement();
                            ResultSet result = statement.executeQuery("SELECT * FROM bike");
                            while ( result.next() )
                                System.out.println(result.getInt(1)+"    "+result.getString(2));                           
                            synchronized ( internalThread2 ) {
                                internalThread2.sleep(10000);
                    catch (Exception e) {
                        e.printStackTrace();
            internalThread2 = new Thread(runner);
            runner = null;
            internalThread2.setPriority(Thread.NORM_PRIORITY);
            internalThread2.start();
        public static void main(String[] args) {
            new SQLConnections();
    }Here is the result I get :
    [greg@ns32 Tests]$ /usr/java/j2re1.4.2_06/bin/java -classpath :mysql-connector-java-3.0.9-stable-bin.jar Tests.SQLConnections
    18 uniqueColor
    19 uniqueColor
    ##### NEW LINE IN DB #####
    18 uniqueColor
    19 uniqueColor
    ##### NEW LINE IN DB #####
    18 uniqueColor
    19 uniqueColor
    [greg@ns32 Tests]$ /usr/java/j2re1.4.2_06/bin/java -classpath :mysql-connector-java-3.0.9-stable-bin.jar Tests.SQLConnections
    18 uniqueColor
    19 uniqueColor
    20 uniqueColor
    21 uniqueColor
    ##### NEW LINE IN DB #####
    18 uniqueColor
    19 uniqueColor
    20 uniqueColor
    21 uniqueColor
    ##### NEW LINE IN DB #####
    18 uniqueColor
    19 uniqueColor
    20 uniqueColor
    21 uniqueColor
    [greg@ns32 Tests]
    I'm doing something stupid?????

  • Create a jdbc connection within forms

    I have created a little piece of java code that connects to my database via a jdbc connection, inserts a value into a table, commits, then closes the jdbc connection.
    This works perfectly in JDeveloper.
    Now, I need to use it within forms, but forms is throwing an exception in the java console: [I have signed the file]
    and I also get an alert that says "FRM-92100: Your connection to the Server was interrupted. This may be the result of a network error or a failure on the Server. You will need to reestablish your session."
    I'm assuming when my java code tries to do a jdbc connection, it conflicts with the already established forms connection. Does anyone have any suggestions on how to overcome this?
    -----------------java console exception-----------------
    java.lang.IllegalAccessException: myconnection
         at java.lang.Class.newInstance0(Native Method)
         at java.lang.Class.newInstance(Unknown Source)
         at oracle.forms.handler.UICommon.instantiate Unknown Source)
         at oracle.forms.handler.UICommon.onCreate(Unknown Source)
         at oracle.forms.handler.ButtonItem.onCreate(Unknown Source)
         at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
         at oracle.forms.engine.Runform.processMessage(Unknown Source)
         at oracle.forms.engine.Runform.processSet(Unknown Source)
         at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
         at oracle.forms.engine.Runform.onMessage(Unknown Source)
         at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
         at oracle.forms.engine.Runform.startRunform(Unknown Source)
         at oracle.forms.engine.Main.createRunform(Unknown Source)
         at oracle.forms.engine.Main.start(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    ------------------java code-------------------------
    NOTES: of course I have taken out the real ip
    address, the db name, and the login and password.
    import java.sql.*;
    import java.io.*;
    import oracle.jdbc.driver.*;
    import oracle.forms.ui.VButton;
    class connection extends VButton
    public static void main (String[] args) {
    try {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    String url = "jdbc:oracle:thin:@<ip>:1521:<databasename>";
    Connection conn = DriverManager.getConnection(url,"<login>","<password>");
    Statement stmt = conn.createStatement();
    ResultSet rs;
    rs = stmt.executeQuery("insert into lh_test (my_name) values ('this')");
    rs = stmt.executeQuery("commit");
    conn.close();
    } catch (Exception e) {
    System.err.println("Got an exception! ");
    System.err.println(e.getMessage());

    Hi 348874,Frank
    Frank,do you thinck that if this java class would extend VBean,instead of VButton will it make any diffence?(I mean,it do has a main method,wich isn't executed when the VButton initialises).
    Ín fact,when having a closer look into the java class(wich ,obvioulsly I didn't last time) I'm quite confused...why is this exception raising?
    This Component should do nothing in fact,when inserted into a form.
    As far as I know,from Forms Applet point of view,this class should be exactly a VButton,because the constructor and init() method are exactly the ones inherited from VButton(This class isn't adding anything to VButton)...Am I wrong??

  • The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.

    Hello All,
    I am getting below error can you please help me
    Error:-
    The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.

    Perhaps this thread will help you out
    http://stackoverflow.com/questions/11453066/error-the-transaction-associated-with-the-current-connection-has-completed-but
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Deployed application can't see the JDBC connection

    Hi
    I made an ADF application using oracle JDeveloper 11g and it ran successfully from the JDeveloper
    I deployed it to Weblogic 10.3 and it successfully deployed
    But when i Opened the deployed application's URL the page's lay out is only what i c (only the template) with the following error:
    =================================================
    Error while opening JDBC connection.
    ORA-01005: null password given; logon denied
    Unexpected exception caught: java.lang.NullPointerException, msg=null
    =================================================
    SO, how could I make my application c the JDBC ?
    by the way when i created the DB connection in the JDeveloper i checked(deploy password)

    Hi Eddy
    I got the same problemas you posted.now i changed the configurations of AMlocal.i changed from JDBC URL to JDBC datasource.
    i saved the changes. i created a new EAR and deployed to external WLS 10.3 from Jdev11.1.1
    when i am testing tha app from external WLS,i am getting the following error
    JNDI failure.unable to lookup DataSource at context
    java:comp/env/jdbc/Connection1DS
    while trying to lookup'jdbc.Connectiobb1DS' didn't find
    subcontext 'jdbc'.Resolved"
    Unexpected exception caught:
    java.lang.NullpointerException,msg=null
    Can you tell me where the problem is?

  • Can't see tables after a JDBC connection

    Hi,
    I made a JDBC connection with Progress9.1d database. In the Connections Navigator, I expand the nodes for my database connection and see the following nodes: Synonyms, Tables, Views.
    However, when I try to expand the "Tables" node, I can't see the tables in the Connections Navigator. A window whose title is "Retrieving Objects" appears for a moment, retrieves the objects as shown by a status bar and disappears immediately.
    Can anyone help me?
    Thank you,
    Meltem

    For those of you having similar problems,
    Here is the answer I received from Oracle Support:
    "We use DatabaseMetaData.getTables() to retrive the information from the database, however, I found on a Progress discussion forum that there is a bug in the Progress implementation of getTables().
    The problem is with their implementation of DatabaseMetaData.getTables(). You have to pass a null into the catalog parameter or it will not work. Under 9.1C if you pass in a blank string ("") you get a "Optional feature not implemented" exception, if you pass in a non-blank string you get "The qualifier 'catalog' was larger than SQL_MAX_QUALIFIER_LEN from SQLGetInfo (0)". My understanding is the issue still exists in 9.1D
    Since we don't pass null here, the problem occurs. So, the problem isn't with JDeveloper, but with the Progress Driver."
    Now, I am talking with Progress Support. I will post another message if anything changes.
    Meltem YILDIRIM

  • Problem w. transaction notSupported / releasing JDBC connections

              We are making a call from our EJB client to a stateless session EJB (1) with transaction attribute 'Required' for all methods. From this EJB (1) we get a JDBC connection from the pool and do some JDBC calls (no updates). We then make a call to a method in another stateles session EJB (2) with transaction attribute 'NotSupported' for all methods. In EJB2 we get a JDBC connection from the pool and do some JDBC calls (no updates). Something goes wrong and we catch a SqlException. We then throw a EJBException. So far everything is OK. But now we get a SqlException from the transaction: 'java.sql.SQLException: Connection is currently associated with xid: 970661671558_182.Rollback attempted in the scope of a different transaction'. It seems like the container tries to perform a rollback on the EJB tat doesn't support transactions. Shouldn't the transaction have been suspended when we entered the method in EJB2? Our problem is that the JDBC connection we got from the pool doesn't get released even though we closed it in a finally-statement in both EJB:s. So after some time we are out of free JDBC connections in our connection pool. Does anyone know why this happens?
              /Per
              

              We are making a call from our EJB client to a stateless session EJB (1) with transaction attribute 'Required' for all methods. From this EJB (1) we get a JDBC connection from the pool and do some JDBC calls (no updates). We then make a call to a method in another stateles session EJB (2) with transaction attribute 'NotSupported' for all methods. In EJB2 we get a JDBC connection from the pool and do some JDBC calls (no updates). Something goes wrong and we catch a SqlException. We then throw a EJBException. So far everything is OK. But now we get a SqlException from the transaction: 'java.sql.SQLException: Connection is currently associated with xid: 970661671558_182.Rollback attempted in the scope of a different transaction'. It seems like the container tries to perform a rollback on the EJB tat doesn't support transactions. Shouldn't the transaction have been suspended when we entered the method in EJB2? Our problem is that the JDBC connection we got from the pool doesn't get released even though we closed it in a finally-statement in both EJB:s. So after some time we are out of free JDBC connections in our connection pool. Does anyone know why this happens?
              /Per
              

  • ABAP statement for JDBC connection to SQL server

    Hi Gurus,
    i need to connect a WebDynpro abap to a SQL server.
    My OS is Unix so i cannot use a ODBC connection.
    Can anyone help me to know if it's possible to write an abap statement to connect the SQL server by JDBC connection?
    thanks a lot
    Regards
    Claudio.

    Hi,
          ELSEIF SCREEN-GROUP2 = 'PRO'.
          clear: list.
          if screen-name = 'ZAVBAK-ZZPROMO_ID'.
            exec sql.
       commit
              set connection :'CBREPOSITORYPRD'
            endexec.
            exec sql.
              CONNECT TO :'CBREPOSITORYPRD'
            endexec.
            exec sql.
              COMMIT
            endexec
          EXEC SQL.
              OPEN C1 FOR
              SELECT CutterRewardsUserListid,
                     SAPAccountNumber,
                     PromoID,
                     FirstName,
                     LastName
                     FROM CutterRewardsUserList
                     WHERE SAPAccountNumber = :XVBPA-KUNNR ORDER BY PromoID
            ENDEXEC.
            DO.
              EXEC SQL.
                FETCH NEXT C1 INTO :WA5
              ENDEXEC.
              IF SY-SUBRC = 0.
                PERFORM UPDATE_LIST.
              ELSE.
                EXIT.
              ENDIF.
            ENDDO.
            EXEC SQL.
              CLOSE C1
            ENDEXEC.

  • Can't start a cloned connection while in manual transaction mode

    Hi every body
    I'm trying to set my connection autoCommit to false and begin a manual transaction in my application .I use sql server 2000 as my dbms and I set the connection selectMethod to "cursor" ,but when I run my application I see this error
    Can't start a cloned connection while in manual transaction mode
    what's wrong??

    Very hard to say using the code posted. However, a few things immediately jump out at me:
    Call setAutoCommit() immediately after getting the Connection. I have never tried calling that method in the middle of a transaction, and I imagine the results are not good.
    Where are your Statements? You should use PreparedStatement whenever possible. At worst, use a Statement. I don't even see that.
    Either commit and rollback yourself, or let auto-commit do it. IMO, whenever you write SQL, you should be coginzant of when a commit or rollback should occur. Therefore, I never use auto-commit.- Saish

  • New ADF Taskflow transaction acquires a new JDBC connection?

    Hi,
    I would like to know more about ADF Taskflow transaction in relation to JDBC Connection.
    tf1 ----(contains)---- page1 and call to tf2
    tf2 ----(contains)---- page2
    page1 - search objects
    page2 - edit objects
    I have two pages part of two taskflows, first taskflow does not create any transaction but the page1 in tf1 shows a searh screen for objects. I want to use transaction behavior of ADF TF for tf2 which is called in tf1.
    My tf2 contains a page for edit objects, if i set New transaction as TF transaction behavior for tf2.
    Does it really acquire a new JDBC connection?
    I really appreciate if someone can help me with this.
    Thanks,
    Sunil.

    "Is there any way to achieve 1 user ---> 1 connection ?"
    I don't claim to be an expert on answering this as there's still a lot of things I need to investigate, and other's in the forum may chime in with more informed answers, but my understanding is you need to:
    a) Use a single root AM
    b) Configure your BTFs to use "shared data control scope" and the same AM
    c) All of your BTFs should use "Use existing transaction if possible"
    Because of "c", the very first BTF called, will not have a transaction to borrow, so it will establish a new transaction and therefore a new connection.
    An alternative is, and I'm on shaky grounds here so please check this for yourself, but you could set all your BTFs to "use no transaction", which implies I believe they switch back to the model used in JDev 10g, where it's purely your AMs that determine connections/transactions.
    As for saying 250 connections sounds very high, that's really up to you. If you build an application that you need to support a user with multiple transactions, it's your requirement that causes this. IMHO Oracle has given you the flexibility to build your application anyway you want, so it's up to you to decide if you want multiple concurrent transactions per user or not.
    Finally regards the behaviour observed in WLS, note that the AM pooling options can influence the behvaiour of connections, so it's hard to say what you're seeing is correct, it depends. A suggestion is to install Oracle's Fusion Middleware Control application and use that for monitoring statistics; the FMW Control has smarts built it to help you observe the AM pooling and connection pooling. Andrejus Baranovskis has a few blog posts describing how he used this to track the pooling options.
    CM.

Maybe you are looking for

  • Wine and KDE hotkeys

    I LIKE the KDE shortcuts so I don't want to permanently disable them.  I would like them to be disabled whenever I run games in fullscreen under wine.  For instance:  Ctrl-F2 switches to desktop 2 which is great...  Accept when I'm playing Diablo II.

  • Image printing problem with Photoshop and Lightroom specifically with 11X14 cuts off top of image and moves bottom border up. Windows 7 OS - Epson Printer is working properly.

    Have an unprecedented problem with printing 11X14 photos in both PS and Lightroom. The printer is operataing properly. Printing 81/2X11 correctly. Have double and triple checked all the printing settings and they are correct. Have checked with friend

  • Data security in MacPro

    Hi, I would like to secure my data in MacPro. How to do this, since there are no MacPro lock available in central Europe? I need to lock the mashine or secure the data in additional hard-drives (I will be working in shared office). Thanks in advance!

  • 2011 macbook pro OSX maverick, error: storage system verify or repair failed

    Hi there, My 2011 Macbook pro which came with Lion but now upgraded to Maverick 10.9.5 has just crashed. It will start up in recovery mode but when I've gone to the apple logo to start up from disk, it shows the disk but doesn't start up from it I ju

  • XSLT issues

    I have following queries regarding XSLT process... 1. In my Empty BPEL process I am receiving data through db partnerlink (through polling) and I am converting it through Transform activity. This time I am only validating my xslt through GUI only. At