CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
change autocommit dynamically with Oracle

 



zatlas1
Novice

Jun 5, 2013, 1:14 PM

Post #1 of 2 (514 views)
change autocommit dynamically with Oracle Can't Post

Hi all

I am connecting to the Oracle database with autocommit=1 since this is what I need most of the time:


Code
  my $dh =  DBI->connect($connect_string, $username, $password,  
{AutoCommit => 1}
) ;



At a certain point I get to where I actually run inserts and for sake of efficiency I do:


Code
  #ZA : Change autocommit locally  
$dh->{AutoCommit} = 0;

-- some code --

$dh->commit;



I get this:

commit ineffective with AutoCommit enabled at ...

On another program that starts with AutoCommit => 0, it seems not to have this problem. Is it possible to change the autocommit option dynamically as I am trying to do?

Thanks

ZA


zatlas1
Novice

Jun 6, 2013, 2:44 PM

Post #2 of 2 (495 views)
Re: [zatlas1] change autocommit dynamically with Oracle [In reply to] Can't Post

There is nothing in the documentation about changing the mode in the middle of the run... I assume that I cannot do that and the AutoCommit could be set once and never changed for the 'session'

Oh well.



ZA

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives