Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1069759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:28:07+00:00 2026-05-16T20:28:07+00:00

I’m calling a third party stored procedure in Oracle from VB that is not

  • 0

I’m calling a third party stored procedure in Oracle from VB that is not rolling back.

Code first (I’m simplifying):

Connection string:

String sqlstr = "SERVER=x.x.x.x;Database=db;uid=sa;pwd=admin;Connect Timeout=60; Min Pool Size=5; Max Pool Size=100;";

The call (I’ve just forced a rollback immediately after the execute to test it):

Dim Oraclecon As New OracleConnection(_OracleConnection)
Dim sqlCon As New SqlConnection(_SQLConnection)
Dim oTrans As OracleTransaction = Nothing

 Oraclecon.Open()
 oTrans = Oraclecon.BeginTransaction()
 Dim myCMD As New OracleCommand()
 myCMD.Connection = Oraclecon
 myCMD.Transaction = oTrans
 myCMD.CommandText = "CREATE_USER"
 myCMD.CommandType = CommandType.StoredProcedure
 myCMD.Parameters.Add(New OracleParameter("username", OracleType.VarChar)).Value = UserName
 myCMD.Parameters.Add(New OracleParameter("passwd", OracleType.VarChar)).Value = Password
 myCMD.Parameters.Add(New OracleParameter("speed", OracleType.VarChar)).Value = Speed
 myCMD.Parameters.Add(New OracleParameter("monthly_quota", OracleType.VarChar)).Value = Quota
 myCMD.Parameters.Add(New OracleParameter("type", OracleType.VarChar)).Value = "H"
 Dim oparam As OracleParameter
 oparam = New OracleParameter("success_flag", OracleType.VarChar)
 oparam.Size = 1
 oparam.Direction = ParameterDirection.Output

 Dim oparam2 As OracleParameter
 oparam2 = New OracleParameter("err_msg", OracleType.VarChar)
 oparam2.Direction = ParameterDirection.Output
 oparam2.Size = 100

 myCMD.Parameters.Add(oparam)
 myCMD.Parameters.Add(oparam2)

 Dim RowId As OracleString

 myCMD.ExecuteOracleNonQuery(RowId)
 oTrans.Rollback()

I can’t give the details of the stored procedure but it does a commit and rollback inside it.

Either way, it is doing an insert, and that immediate rollback does not rollback the insert.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:28:07+00:00Added an answer on May 16, 2026 at 8:28 pm

    The Commit/Rollback logic in the PL/SQL (regardless of AUTONOMOUS TRANSACTION clause –> DO NOT USE THIS unless you are error logging: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2212445691154)

    So if you issue a COMMIT in your package your data is commited, PERIOD. Rollback the same way.

    Create table for the following examples:

    create  table SHOW_TRANSACTION (MISC varchar2(15)) ;
    /
    

    Looking at this example shows just that:

    declare
    
       procedure DOTHEINSERT(DATAM in SHOW_TRANSACTION.MISC%type ,
                            doCommit IN boolean
    
       ) 
       as
       begin    
                insert into SHOW_TRANSACTION (MISC) 
                values (DATAM);
    
                if DOCOMMIT   then
                   commit ;
                else
                   ROLLBACK ;
                end if;
       end ;
    begin
        DOTHEINSERT('commit1' , true);
        DOTHEINSERT('NOcommit1' , false);
        DOTHEINSERT('commit2' , true);
        DOTHEINSERT('NOcommit2' , false);
        DOTHEINSERT('commit3' , true);
        ROLLBACK;
    
    
    end ;
    /
    
    select * from SHOW_TRANSACTION ;
    /
    MISC            
    --------------- 
    commit1         
    commit2         
    commit3   
    

    Notice the final ROLLBACK does nothing? this is because the COMMIT/ROLLBACKS in the procedure are effecting the entire scope, look at this example:

    truncate table SHOW_TRANSACTION; --start with clean slate
    
    declare
    
       procedure DOTHEINSERT(DATAM in SHOW_TRANSACTION.MISC%type ,
                            doCommit IN boolean
    
       ) 
       as
       begin    
                insert into SHOW_TRANSACTION (MISC) 
                values (DATAM);
    
                if DOCOMMIT   then
                   commit ;
                --else (HERE I AM GETTING RID OF THE PROCEDURES ROLLBACK, SO EVERYTHING IS BEING ROLLBACK'ED
                --   ROLLBACK ;
    
                end if;
       end ;
    begin
        DOTHEINSERT('commit1' , true);
        DOTHEINSERT('NOcommit1' , false);
        DOTHEINSERT('commit2' , true);
        DOTHEINSERT('NOcommit2' , false);
        DOTHEINSERT('commit3' , true);
        ROLLBACK;
    
    
    end ;
    /
    
    select * from SHOW_TRANSACTION ;
    /
    
    MISC            
    --------------- 
    commit1         
    NOcommit1       
    commit2         
    NOCOMMIT2       
    commit3     
    

    Here the package ROLLBACK is removed, so when that COMMIT happens, the contents of all the INSERTS prior to that are inserted.

    If you want the VB application to handle the transaction, you must remove the commit/rollback from the PL/SQL.

    Also, it does not matter where the commit/rollback are, they are indicative to the ENTIRE SCOPE of all items in the transaction:

    truncate table SHOW_TRANSACTION ; 
    
    declare
    
       procedure DOTHEINSERT(DATAM in SHOW_TRANSACTION.MISC%type ,
                            doCommit IN boolean
    
       ) 
       as
              procedure DOTHETRANSACTION(doCommit IN boolean) as 
              begin
                if DOCOMMIT   then
                   commit ;
                else -- (HERE I AM GETTING RID OF THE PROCEDURES ROLLBACK, SO EVERYTHING IS BEING ROLLBACK'ED
                   ROLLBACK ;
                end if;             
              END DOTHETRANSACTION;
       begin    
                insert into SHOW_TRANSACTION (MISC) 
                values (DATAM);
                DOTHETRANSACTION(doCommit);
       end DOTHEINSERT;
    begin
        DOTHEINSERT('commit1' , true);
        DOTHEINSERT('NOcommit1' , false);
        DOTHEINSERT('commit2' , true);
        DOTHEINSERT('NOcommit2' , false);
        DOTHEINSERT('commit3' , true);
        ROLLBACK;
    
    
    end ;
    /
    
    select * from SHOW_TRANSACTION ;
    /
    
    MISC            
    --------------- 
    commit1         
    COMMIT2         
    commit3 
    

    /* now the transaction is in a sub-sub procedure */

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.