Solved

Savepoints, Rollbacks in forms

Posted on 1999-01-14
2
1,742 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

623 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