A Note About ORA-02041: client database did not begin a transaction...

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default A Note About ORA-02041: client database did not begin a transaction...

    I received this error message when I was running my
    package.procedure to access a remote database
    view -- via a database link -- on one database
    to another. (I am using the Oracle OLEDB Provider: Provider=OraOLEDB.Oracle)
    I was able to eliminate it by adding this line of code to
    my procedure:

    SET TRANSACTION READ ONLY;

    before the SELECT statement in my procedure and add

    COMMIT;

    after the SELECT statement in my procecure. Hope this
    helps someone out there!!

    My final package/procedure (called SCOTTPAK.SQL) looks like this:

    CREATE OR REPLACE PACKAGE SCOTTPAK AS

    TYPE curREFCUR IS REF CURSOR;

    PROCEDURE GetStuff (pkey IN NUMBER,
    a_cursor OUT curREFCUR);

    END SCOTTPAK;
    /
    SHOW ERRORS
    CREATE OR REPLACE PACKAGE BODY SCOTTPAK AS

    PROCEDURE GetStuff (pkey IN NUMBER,
    a_cursor OUT curREFCUR) IS

    BEGIN

    --ADD THIS LINE!!
    SET TRANSACTION READ ONLY;

    OPEN a_cursor FOR
    SELECT COL1,COL2,COL3
    FROM ops$admin.vwMyView@myDBLink
    WHERE product_key=pkey;

    --ADD THIS LINE!!
    COMMIT;

    END GetStuff;

    END SCOTTPAK;
    /
    SHOW ERRORS
    Scott Guest

  2. Similar Questions and Discussions

    1. Database corrupt, can we use the transaction log?
      We discovered yesterday database corruption and with help from my previous posting we checked the database. A few tables do have problems and...
    2. A note to add to ASPFAQ.com for database compacting
      I also forgot to mention that inherited deny permission take precedence over allow permissions. joker wrote: > Well here are some articles...
    3. Transaction id and transaction isolation
      Hi Two questions. I am using Informix IDS 9.4 on Windows. 1. I would like to be able to get hold of the transaction id while still in the...
    4. Error in Database Transaction
      Has any one see the following error message. System.Runtime.InteropServices.COMException (0x8004D025): The partner transaction manager has...
    5. Connecting to Oracle 8.0.4 Database using 8.1.7 client
      I am installing an SAP application server, and would like it to be as clean as possible. Is it possible to use Oracle 8.1.7 client software to...
  3. #2

    Default A Note About ORA-02041: client database did not begin a transaction...

    I received this error message when I was running my
    package.procedure to access a remote database
    view -- via a database link -- on one database
    to another. (I am using the Oracle OLEDB Provider: Provider=OraOLEDB.Oracle)
    I was able to eliminate it by adding this line of code to
    my procedure:

    SET TRANSACTION READ ONLY;

    before the SELECT statement in my procedure and add

    COMMIT;

    after the SELECT statement in my procecure. Hope this
    helps someone out there!!

    My final package/procedure (called SCOTTPAK.SQL) looks like this:

    CREATE OR REPLACE PACKAGE SCOTTPAK AS

    TYPE curREFCUR IS REF CURSOR;

    PROCEDURE GetStuff (pkey IN NUMBER,
    a_cursor OUT curREFCUR);

    END SCOTTPAK;
    /
    SHOW ERRORS
    CREATE OR REPLACE PACKAGE BODY SCOTTPAK AS

    PROCEDURE GetStuff (pkey IN NUMBER,
    a_cursor OUT curREFCUR) IS

    BEGIN

    --ADD THIS LINE!!
    SET TRANSACTION READ ONLY;

    OPEN a_cursor FOR
    SELECT COL1,COL2,COL3
    FROM ops$admin.vwMyView@myDBLink
    WHERE product_key=pkey;

    --ADD THIS LINE!!
    COMMIT;

    END GetStuff;

    END SCOTTPAK;
    /
    SHOW ERRORS
    Scott Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139