Rollback on transaction failes

Hi,
I have got a problem when I try to rollback a transaction using a JDBC driver, but I don't understand why. Maybe someone can help me.
My problem is as follows:
on a connection with AutoCommit set to true, I define some INSERT actions on a certain table. Hereafter I do a commitTransaction(). This generates a SQLException, which I catch. In this catch I do a connection.rollback(). This results in the following error:
[SQLServer JDBC Driver]Not in local manual transaction mode
Does anyone know what this means and what causes this?
Regards,
Onno Kievit

Hi Onno,
If you have enabled "auto commit", then you cannot call methods like "commit()" or "rollback()". After you have executed your INSERT, a "commit" automatically happens -- if the INSERT succeeds -- or a "rollback" automatically happens (if the INSERT fails). You are calling the "commit()" method when there is no open transaction -- which is wrong and therefore you get an error (SQLException).
Same problem occurs when you catch the error caused by your "commit" and try to "rollback" -- you cannot "rollback" when there is no open transaction.
As I see it, you have two choices:
1. disable auto commit, or
2. remove the calls to "commit()" and "rollback()"
Hope this helps you.
Good Luck,
Avi.

Similar Messages

  • How can I rollback a transaction using EJBContext.rollbackOnly()?

    I failed to rollback a "required" method of a seesion bean using EJBContext.rollbackOnly() , but it rollbacked if I throw EJBException , how can I rollback a transaction by
    EJBContext.rollbackOnly() ? Thanks for your help.
    regards,
    dean

    The full and partial updates (whether it be Thunderbird, Firefox or SeaMonkey) from mozilla.org are only provided to the official builds and not builds built yourself or by a third-party.
    The openSUSE and other Linux distro provided builds have their own ways of package updates in their package manager.
    However if the poster is using Thunderbird for Linux from http://www.mozilla.org/en-US/thunderbird/ (64-bit Linux is on ftp) then those preferences would be valid and work.
    Nothing is being gutted as it has been this way since forever with third-party builds whether on Windows, Mac OSX and Linux.

  • Custom table entry if transaction fails

    hey ppl,
    One doubt. I am using a exit in sales order and the requirement is that once the exit is triggered,few values must be updated on the custom table that i have created. My question s that, i am able to modify my custom table but if for some reason ,after my exit if the transaction fails :
    1. would the custom table entry be reversed back automatically?
    2. Else, is it our responsibility to reverse the entry in the custom table?If yes, can you please guide me how to do it?
    Thanks in advance.

    1. would the custom table entry be reversed back automatically? Can't be sure on this. the entry will be updated to table once the Current LUW is updated.
    2. Else, is it our responsibility to reverse the entry in the custom table?If yes, can you please guide me how to do it?
    Yes. If entry is there you wll require to DELETE it otherwise you can just to ROLLBACK WORK.

  • Transaction failed for unknown reason (100) Unable to complete backup at this time. Does anyone know how to solve this issue?

    Transaction failed for unknown reason (100) Unable to complete backup at this time. Does anyone know how to solve this issue?
    Thanks.

    The system is set up to backup files to the iCloud at the end of the day. This has ot happen for sometime now and the mesaage I get is the back up error.

  • Deferred transaction fails due to a "ORA-01403: no data found" error

    I recently acticated replication between two Oracle instances.
    (one being the master definition site and the other one being
    a second master site).
    Everything was going well until two weeks ago, when i realized
    that some datas were different between the two Oracle instances.
    I tried to figure out why and found that some deferred transation
    failed to propagate due to a "ORA-01403: no data found" error.
    Not all transaction fail, only a few.
    All the errors are stored in the DEFERROR table of the second
    master site, the DEFERROR table is empty in the master definition
    site.
    For every error, the source is the master definition site and the
    destination is the second master site, which is OK because the
    second master site is supposed to be "read-only". But why are the
    errors stored in the DEFERROR table of the second master site
    (and not in the master definition site (the source)).
    Most errors occur on UPDATE statements but a few of them occur
    on DELETE statements. Given the fact that the record actually is
    in the second master site, how is it possible to get a
    "ORA-01403: no data found" error on a delete statement ???????
    I can't figure out what data cannot be found,
    Thanks for your help,
    Didier.

    What if i tell you the first transaction in error is an UPDATE
    statement on a record that actually is in the destination table
    in the second master site. So the data is there, it should be
    found ...
    I've tried an EXECUTE_ERROR on that very first transaction
    in error but it doesn't work. Here's the call (as repadmin) :
    begin
    DBMS_DEFER_SYS.EXECUTE_ERROR (
    DEFERRED_TRAN_ID => '6.42.271',
    DESTINATION => 'AMELIPI.SENAT.FR'
    end ;
    And here's the full message :
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_DEFER_SYS_PART1" line 430
    ORA-06512: at "SYS.DBMS_DEFER_SYS" line 1632
    ORA-06512: at "SYS.DBMS_DEFER_SYS" line 1678
    ORA-06512: at line 2
    I thought it could be because the primary key constraint on the
    destination table wasn't activated but it was. Could it
    be a problem with the corresponding index ?
    Thanks for your help,
    Didier.

  • RequiresNew transaction fails in case of nested EJB, is it known issue ?

    Hi friends,
    we are facing a peculiar problem across entire application. All the nested ejb transactions with transaction attribute as RequiresNew fail, when the main transaction fails.
    This is wrong as,  if a nested transaction has attribute as RequiresNew , it should succeed even if main transaction fails. It works fine with websphere
    for e.g
    EJB A has methodA(), which calls methodB() of EJB B. methodB() inserts few rows in DB and returns to caller methodA(). Now methodA() fails due to some reason.
    In case of Netweaver 04s the rows inserted by mentodB() are rolled back which is wrong.
    Is this a known issue ? Is there any work around ?

    Hi All,
    Still this thread is unanswered, Is there any genius who has done Transaction handling on Adpaters (MQ or JMS). I have look into may threads on forums, but no appropriate information is given about this issue. If this thread is been answered then it will be very helpfull for othes dealing with transaction in MQ.
    Thanks
    Sunil

  • ORA-20998: Transaction Failed on Headstart Utilities 6.5 installation

    Hello,
    I am having problem when running insthsu.sql script to install
    Headstart utilities 6.5. We are doing client/server approach. The
    server is Sun 450 - Oracle 8.1.7.0.0
    Designer 6i Release 4 repository was installed on the server.
    How far was the installation:
    1. Installed HST65 --> No problem found
    2. Installed HDEMO65 --> No problem found
    3. Failed on the following statement on insthsu.sql script:
    ... installing Quality Check utilities
    execute hsu_qa_app.install;
    error message:
    hsu65@devl> execute hsu_qa_app.install
    BEGIN hsu_qa_app.install; END;
    ERROR at line 1:
    ORA-20998: Transaction Failed
    ORA-06512: at "HST65.QMS$ERRORS", line 128
    ORA-06512: at "HST65.QMS_TRANSACTION_MGT", line 814
    ORA-06512: at "HSU65.CG$AIS_HSU_UTILITIES", line 39
    ORA-04088: error during execution of
    trigger 'HSU65.CG$AIS_HSU_UTILITIES'
    ORA-06512: at "HSU65.HSU_INSTALL", line 132
    ORA-06512: at "HSU65.HSU_QA_APP", line 40
    ORA-06512: at line 1
    Any idea or direction where should I go from here?
    Thanks,
    Sanny Subowo

    Ali,
    You are running into a bug in the install form. It sees the tables that you imported manually (like the message told you to do), and then complains about them. The best thing to do is change the code in the hsdinst.fmb where the check for existing objects is performed in program units CHECK_USERS:
    function hsu_objects_exist
    return boolean
    is
    cursor c_chk
    is
    select 'x'
    from user_objects
    where object_name like 'BL_%'
    -- or object_name like 'HSU_%'
    -- or object_name like 'OMR_%'
    So comment out the two lines as indicated above and recreate the fmx.
    Kind regards,
    Peter

  • TS1424 I purchased a giant stash of accorns, and it said contact itunes store for trouble, I was told transaction failed,  then billed for the cheaper stash twice,  how do I fix this ?

    what do you do when you try to purchase an item for a game on ipad, and it says transaction failed,  though you were billed for two of the lower level items?

    Hey everyone in Apple world!
    I figured out how to fix the flashing yellow screen problem that I've been having on my MBP!  Yessssss!!!
    I found this super handy website with the golden answer: http://support.apple.com/kb/HT1379
    I followed the instructions on this page and here's what I did:
    Resetting NVRAM / PRAM
    Shut down your Mac.
    Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.
    I went through the 6 steps above twice, just to make sure I got rid of whatever stuff was holding up my bootup process.  Since I did that, my MBP boots up just like normal.  No flashing yellow screen anymore!!   
    (Note that I arrived at this solution when I first saw this page: http://support.apple.com/kb/TS2570?viewlocale=en_US)
    Let me know if this works for you!
    Elaine

  • MSCA-Receiving PO items from Scanners- *Online transaction fail*

    Hi,
    While receiving PO's from scanners,getting the following error - "Online transaction fail"..issue is only with one OU..i can receive in another OU in same instance...also issue is specific to one instance.
    Has any one encountered such issue?
    Rgds,AP

    Helios,
    Many thanks for quick answer..not sure this note would help me..as mentioned earlier issue is only with one particular OU..in the same instance..other OU's are working..in another test instance even this OU is also working..not sure how to debug.
    Any support is much appreciated.
    -AP

  • In App purchasing transaction failed.

    I can't purchase in App purchasing because it always say transaction failed please contact iTunes support. iTunes support didn't help at all though. I am trying to purchase in App purchases in Deer Hunter Reloaded for IPad 1

    Please refer to one of your other posts with the same question. There is NO need to post the same question multiple times.

  • Authorization of credit card transaction failed. Failure in Authorization

    Hello All,
    I am getting the below error while doing Auto-Receipts in R12.1.3.
    Authorization of credit card transaction failed. Failure in Authorization
    Please guide me to identify the issue.
    Thanks and Regards,
    Muthu

    Hi,
    Thank you very much for your support.
    But still i'm getting the same error. I read in one site the below step(Marked as Bold), This could be the reason why the error is occurring..
    But I don't know how to check, If any one know about the below step, let me know.
    Depending upon the function security options set up by your system administrator, you might be able to create, format, and approve Automatic receipt batches in one step.
    Thanks and Regards,
    Muthu

  • Rollback a transaction in a session bean BMP?

    The following code would work correctly if executed in a stateless session bean BMP?
    InitialContext ic = new InitialContext();
    javax.sql.DataSource dataSource = (javax.sql.DataSource) ic.lookup("java:comp/env/jdbc/OracleDS");
    Connection conn = dataSource.getConnection();     
    conn.setAutoCommit(false);
    Statement stmt = conn.createStatement("UPDATE TABLE_A SET NAME = 'Duke' WHERE ID = 7");
    stmt.executeUpdate();
    if (someCondition) {
    conn.commit();
    } else {
    conn.rollback();
    My question:
    It�s possible to rollback a transaction using rollback() from Connection class in a stateless
    session bean BMP?

    Dear JDC member:
    With EJB, you can gain the benefit of transactions without performing any transaction programming. That is, your enterprise beans never explicitly issue a begin, commit, or abort statement. The container performs it to you. But you have to tell the container how to do it. As you might know, the deploment descriptor is the place for it.
    But nothing prevent you to do do programmatic transaction as you want.. For that case you have to know JTA (Java Transaction API) and more.
    Suppose the transaction aborts, you have to throw an exception back to the client or try it again. The issue here is with stateless sesssion beans, there is no in-memory conversational state. You might think to implement javax.ejb.SessionSynchronization interface with your business methods....
    You see there is a lot to know. You can take care of transactions in the client code, but it is a bad design.
    You have to understand today most application servers (Websphere, Weblogic...) are designed to minimize those issues in order to make developers' tasks easier. The container takes care of transactions.
    Be careful when you write stateless session beans BMP (BMP are for entiti beans)
    Regards,
    Armand Komenan

  • 554 Transaction Failed

    All,
    We have set the following parameters in our SAP system but still get an error when sending an email to the SAP system.
    The parameters are:
    icm/server_port_1 = PROT=SMTP,PORT=8025
    is/SMTP/virt_host_0 = *:8025;
    In SICF we have the SMTP node active with logon data and handler list (CL_SMTP_EXT_SAPCONNECT). And the user has S_A.SCON profile yet the bounced email says:
    Sent by Microsoft Exchange Server 2007
    Diagnostic information for administrators:
    Generating server: yailman.zimmer.net
    wf-batch[at]ebp.zimmer.net
    yailman.zimmer.net #554 Transaction failed ##
    Original message headers:
    Received: from yailman.zimmer.net ([192.168.5.3]) by yailman.zimmer.net
    ([192.168.5.3]) with mapi; Mon, 13 Oct 2008 12:40:42 +0100
    Content-Type: multipart/mixed;
         boundary="_000_6BA065A70BF77849B8DB38F17E9B82595884E750B3yailmanzimm_"
    From: A Other Parsson <AO.Parsson [at] zimmer.net>
    To: EBP <wf-batch[at]ebp.zimmer.net>
    Date: Mon, 13 Oct 2008 12:40:41 +0100
    Subject: TEST1
    Thread-Topic: TEST1
    Thread-Index: AQHJLSiFca6hxlAl4UOF8hc9pBJ1zQ==
    Message-ID: <6BA065A70BF77849B8DB38F17E9B82595884E750B3[at]yailman.zimmer.net>
    Accept-Language: en-US, en-GB
    Content-Language: en-GB
    X-MS-Has-Attach:
    X-MS-TNEF-Correlator: <6BA065A70BF77849B8DB38F17E9B82595884E750B3[at]yailman.zimmer.net>
    acceptlanguage: en-US, en-GB
    MIME-Version: 1.0
    Has anyone come across this error and how did you resolve it?
    Edited by: Graham Moisley on Oct 13, 2008 3:40 PM
    Can someone advise on what specific steps need to taken to get MS Exchange to send emails to SAP. Can you share a document if you have one?

    Hi,
    The "554 Transaction failed" error message is usually caused by the fact that the user maintained in SICF -> SAPconnect -> Logon data password is incorrect
    Could you please enter a user in here that has the SAP_ALL profile and try to send a test mail into the SMTP plug-in per your attachment.   
    If this mail is delivered correctly could you please create a new
    user as below and see if the mail is delivered in the SAP system:-   
    (1) SU01 -> New user "SAPCONNECT"
    (2) User type "Dialog"
    (3) Logon with this user so that the initial password is changed
    (4) Back into SU01
    (5) Profile "S_A.SCON"
    (6) User type "Communications Data" so that password is never changed
    Please enter this user into the SAPconnect SICF service and see if you can send emails into the SMTP plug-in per the telnet test outlined in SAP Note 607108.
    Hope this helps
    Michael

  • Transaction Failed

    Hi,
    I have some troubles with checking an array's content.
    Here's my applet :
    package monpackage;
    import javacard.framework.APDU;
    import javacard.framework.Applet;
    import javacard.framework.ISO7816;
    import javacard.framework.ISOException;
    import javacard.framework.JCSystem;
    import javacard.framework.Util;
    import javacardx.apdu.ExtendedLength;
    public class MonApplet extends Applet{
         private MonApplet() {
         public final static byte CLA = (byte) 0x10;
         public final static byte INS_GET_ARRAY_SIZE = (byte) 0x80;
         public final static byte INS_GET_ARRAY_CONTENT = (byte) 0x20;
         public final static byte INS_CHECK_ARRAY_INTEGRITY = (byte) 0x40;
         public static byte[] array = null;
         public static void install(byte bArray[], short bOffset, byte bLength)
                   throws ISOException {
              new MonApplet().register();
              short arraySize = 2048;
              boolean foundMaxSize = false;
              while (!foundMaxSize) {
                   try {
                        array = JCSystem.makeTransientByteArray(arraySize, JCSystem.CLEAR_ON_RESET);
                        foundMaxSize = true;
                   catch(Exception e){
                        arraySize--;
         public void process(APDU apdu) throws ISOException {
              byte[] buf = apdu.getBuffer();
              byte cla = buf[ISO7816.OFFSET_CLA];
              byte ins = buf[ISO7816.OFFSET_INS];
              short bytesLeft = (short) (buf[ISO7816.OFFSET_LC] & 0x00FF);
              short readCount = apdu.setIncomingAndReceive();
              while (bytesLeft > 0) {
                   bytesLeft -= readCount;
                   readCount = apdu.receiveBytes(ISO7816.OFFSET_CDATA);
              if (selectingApplet()) return;
              if (cla != CLA) ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
              short le = apdu.setOutgoing();
              switch (ins) {
              case INS_GET_ARRAY_SIZE:
                   apdu.setOutgoingLength((short)2);
                   Util.setShort(buf, ISO7816.OFFSET_CDATA, (short)array.length);
                   apdu.sendBytes(ISO7816.OFFSET_CDATA, (short)2);
                   break;
              case INS_GET_ARRAY_CONTENT:
                   short dumpOffset = (short)((short)(buf[ISO7816.OFFSET_P1] & 0x00FF) * 256 + (short)(buf[ISO7816.OFFSET_P2] & 0x00FF));
                   if (dumpOffset > array.length) {
                        ISOException.throwIt(ISO7816.SW_INCORRECT_P1P2);
                   if ((short) (dumpOffset+le) >= array.length) {
                        le = (short) (array.length - dumpOffset);
                   apdu.setOutgoingLength(le);
                   Util.arrayCopy(array, dumpOffset, buf, (short)0, le);
                   apdu.sendBytes((short)0, le);
                   break;
              case INS_CHECK_ARRAY_INTEGRITY:
                   // array[(short)(array.length-1)] = (byte)1;
                   for (short i=0; i<array.length; i++) {
                        if (array[i] != (byte)0) {
                             apdu.setOutgoingLength((short)2);
                             Util.setShort(buf, (short)0, i);
                             apdu.sendBytes((short)0, (short)2);
                   break;
              default:
                   ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
    }The problem is when I send te command 0x10 40 00 00 01 01 02, according to me I shoul get a 9000 and no data.
    What I get is "send_APDU() returns 0x80100016 (Transaction failed.)" (I'm using gpshell).
    If I uncomment the line : // array[(short)(array.length-1)] = (byte)1;
    Then all works fine and I get 0x051F 9000. (my array is actually 0x0520).
    (the other instructions work fine)
    I tried reducing the array size to 32, that didn't change anything.
    Can anybody please tell me what's going on? (yeah Marvin!! What's goin' on)
    Thx a lot!
    YoM (\/)
    <noob 4 life> (^.^)
    (")(")

    ICDeadCode wrote:
    A few comments:
    - you shouldn't call apdu.setIncomingAndReceive() systematically, as it will process P3 an an incoming data length (Lc). For case 2 commands, where P3 is the outgoing data length (Le), you will have an APDUException because the platform will try to receive command data that doesn't exist. Of course, if you know that ALL of your commands have incoming data, then you can do this.I was doing this because of the problem I had (..I have?) there :
    [http://forums.sun.com/thread.jspa?threadID=5348599&tstart=15]
    - you mustn't call setOutgoingLength() more than once. It will result in an APDUException with ILLEGAL_USE reason (check the Javadoc)
    Here, you're calling setOutgingLength() inside a loop, so it's very likely that an APDUException was thrown.That's what I call Quick&Dirty xD
    Thanks a lot for those helpful comments!
    YoOm
    <[still]noob [still] for life>
    (^.^)
    (")(")

  • [SEND_REPLY(9)] [C4036]: A server error occurred. : transaction failed:

    Anyone know why I'm getting this error? On the client side I'm getting the following exception:
    [SEND_REPLY(9)] [C4036]: A server error occurred. : transaction failed: Unexpected Broker
    Exception: [received message with Unknown Transaction ID -1: ignoring message] user=guest, broker=localhost:7676(3243)
    at com.sun.messaging.jmq.jmsclient.ProtocolHandler.throwServerErrorException(ProtocolHandler.java:3059)
    at com.sun.messaging.jmq.jmsclient.ProtocolHandler.writeJMSMessage(ProtocolHandler.java:1555)
    at com.sun.messaging.jmq.jmsclient.WriteChannel.sendWithFlowControl(WriteChannel.java:123)
    at com.sun.messaging.jmq.jmsclient.WriteChannel.writeJMSMessage(WriteChannel.java:76)
    at com.sun.messaging.jmq.jmsclient.Transaction.send(Transaction.java:128)
    at com.sun.messaging.jmq.jmsclient.SessionImpl.writeJMSMessage(SessionImpl.java:683)
    at com.sun.messaging.jmq.jmsclient.MessageProducerImpl.writeJMSMessage(MessageProducerImpl.java:155)
    at com.sun.messaging.jmq.jmsclient.MessageProducerImpl.writeJMSMessage(MessageProducerImpl.java:145)
    at com.sun.messaging.jmq.jmsclient.MessageProducerImpl.send(MessageProducerImpl.java:499)
    In the broker log, I'm getting this:
    [03/Nov/2005:11:13:24 PST] WARNING [B3100]: Unexpected Broker Internal Error : [transaction failed] :
    com.sun.messaging.jmq.jmsserver.util.BrokerException: Unexpected Broker Exception: [received message with Unknown Transaction ID -1: ignoring message]
         at com.sun.messaging.jmq.jmsserver.data.TransactionList.addMessage(TransactionList.java:216)
         at com.sun.messaging.jmq.jmsserver.data.handlers.DataHandler.handle(DataHandler.java:141)
         at com.sun.messaging.jmq.jmsserver.data.handlers.DataHandler.handle(DataHandler.java:59)
         at com.sun.messaging.jmq.jmsserver.data.PacketRouter.handleMessage(PacketRouter.java:146)
         at com.sun.messaging.jmq.jmsserver.service.imq.IMQConnection.readData(IMQConnection.java:1847)
         at com.sun.messaging.jmq.jmsserver.service.imq.IMQConnection.process(IMQConnection.java:816)
         at com.sun.messaging.jmq.jmsserver.service.imq.OperationRunnable.process(OperationRunnable.java:141)
         at com.sun.messaging.jmq.jmsserver.util.pool.BasicRunnable.run(BasicRunnable.java:459)
         at java.lang.Thread.run(Thread.java:595)
    [03/Nov/2005:11:13:24 PST] ERROR [B3100]: Unexpected Broker Internal Error : [Unknown transaction: -1(-1) broker will  not notify the client Ignoring ROLLBACK_TRANSACTION(48)
          Packet: ROLLBACK_TRANSACTION(48):117-192.168.0.2(e7:cb:48:e:43:5d)-4127-1131045204302
      Magic/Version: 469754818/301     Size: 112      Type: ROLLBACK_TRANSACTION(48)
         Expiration: 0                 Timestamp: 1131045204302
          Source IP: 192.168.0.2(e7:cb:48:e:43:5d)  Port: 4127     Sequence: 117
    Property Offset: 76               Property Size: 36
         Encryption: 0     Priority: 5
              Flags:                   consumerID: 0
         TransactionID: 0
           MessageID: 117-192.168.0.2(e7:cb:48:e:43:5d)-4127-1131045204302
         Properties: {JMQTransactionID=-1}
    Message Body: 0 bytes
    Internal Buffers (useDirect=false):
    Fixed Header Buffer:java.nio.HeapByteBuffer[pos=0 lim=72 cap=72]
    ]

    Please provide more information,
    . what is the version of MQ you are using ?
    (see top of the broker log)
    . are you using MQ cluster ?
    . describe your application
    amy

Maybe you are looking for