Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How do I prevent "commit" when a program crashes???

Re: How do I prevent "commit" when a program crashes???

From: Steve Phelan <stevep_at_pmcgettigan.demon.co.uk>
Date: 1997/04/23
Message-ID: <335DBA6E.ACB19276@pmcgettigan.demon.co.uk>#1/1

Z. Martinez wrote:

> I have a Pro*C program that I am working on.
>
> Currently, I commit after every 10,000 inserts. However, I noticed
> that when I break out of the program while in execution (using
> ctrl+C), the uncommitted records are committed to the database.
>
> How do I prevent this from happening???
>
> I'm working on Oracle 7.3 under HPUX.
>
> Thanks in advance.
>
> Please respond to zlm101_at_psu.edu

 Well, based on my knowledge of Pro*C this should not be happening. Think about it: you would normally have to explicitly EXEC SQL COMMIT to get your data stored, so why should a simple CTRL-C do this for you?

I suspect you either have some form of auto-commit feature switched on or your code is passing through a commit that you haven't noticed. Have you tried stepping through your code with a debugger and tracing exactly where it goes when you hit CTRL-C?

Another point: I always code an 'exit handler' in my Pro*C programs to catch software termination requests (CTRL-C, kill <pid>, etc.) and explicitly perform an EXEC SQL ROLLBACK and a clean disconnect from the database. You might want to look into this. Look at 'signal' handling in your environment.

Steve Phelan. Received on Wed Apr 23 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US