Solved

Savepoints, Rollbacks in forms

Posted on 1999-01-14
2
1,576 Views
Last Modified: 2008-02-20
I issue an insert into statement and before comitting I issue a clear_block(no_validate) to cancel the transaction, but the insert statement is not rolled back.  When I issue a rollback the command will delete my headings(title, datetime, userid etc.) off of the form.  I have tried using a savepoint that I set just after I set up my headings on the form and isssue the rollback to savepoint, but it still does not seem to work.  Can I rollback my insert into statement without clearing out my complete form?
0
Comment
Question by:murphydp
2 Comments
 
LVL 35

Expert Comment

by:Mark Geerlings
ID: 1083672
A "clear_block" will only undo uncommitted inserts, updates or deletes in the current block.  It will not rollback any other statements that the form may have done since the last commit.

I usually save the userid and current date in global variables (Forms4.5 or earlier) or in a client-side package (Forms5.0 or later) and reset them in the form in the when-clear-form trigger.  That technique will not prevent the problem you are having, but it may give you a work around.
0
 

Accepted Solution

by:
jsanand earned 50 total points
ID: 1083673
Dear Murphydp,

You are right !!! The userid and other fields are changed to null when you issue a rollback command in forms. This is because forms internally issues a clear form for this.

To solve you problem you should use the form built in's

ISSUE_SAVEPOINT(<savepoint_name>);
ISSUE_ROLLBACK(<savepoint_name>);

Before entering the block mark a save point and issue a rollback when requires using the form builtin

Another work around to you problem is !!
based on certain condition the ON_INSERT trigger should fail
eg
  ON_INSERT trigger
 
  Begin
    If EVERYTHING_OK then
       INSERT_RECORD;
    Else
       NULL;
  End;

This way the record will not be inserted into the database and you even do not need to issue a rollback command

Hope this will solve your problems
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Oracle Next Available Number 2 44
Fastest way to replace data in Oracle 5 64
PL/SQL Display based on value 4 29
Oracle encryption 12 31
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question