Savepoint issue

create table test (num NUMBER);
insert into test values(1);
insert into test values(9);
savepoint a;
insert into test values(7);
update test set num=100 where num=9;
savepoint b;
delete from test where num=1;
commit;
delete from test where num=1;I am getting an error when i issue
rollback to savepoint a;
error
SQL Error: ORA-01086: savepoint 'A' never established
01086. 00000 -  "savepoint '%s' never established"
CORRECTED THE ERROR CODE
Edited by: Rahul India on Feb 19, 2013 2:39 PM

Hi,
See below which I executed in my database (11.2)
You are getting the error because you are using ROLLBACK TO <Savepoint_Name> after executing the COMMIT. After commiting savepoints which were created previously will not exist.
SQL> create table test (num NUMBER);
Table created
SQL> insert into test values(1);
1 row inserted
SQL> insert into test values(9);
1 row inserted
SQL>  savepoint a;
Savepoint created
SQL> insert into test values(7);
1 row inserted
SQL>  update test set num=100 where num=9;
1 row updated
SQL>  savepoint b;
Savepoint created
SQL> delete from test where num=1;
1 row deleted
SQL> commit;
Commit complete
SQL> delete from test where num=1;
0 rows deleted
SQL> rollback to savepoint a;
rollback to savepoint a
ORA-01086: savepoint 'A' never established in this session or is invalid
SQL> If I remove COMMIT then SAVEPOINT will exist
SQL>  insert into test values(1);
1 row inserted
SQL>  insert into test values(9);
1 row inserted
SQL>   savepoint a;
Savepoint created
SQL>  insert into test values(7);
1 row inserted
SQL>   update test set num=100 where num=9;
1 row updated
SQL>   savepoint b;
Savepoint created
SQL>  delete from test where num=1;
1 row deleted
SQL>  delete from test where num=1;
0 rows deleted
SQL>  rollback to savepoint a;
Rollback complete
SQL> Edited by: Suri on Feb 19, 2013 2:40 PM

Similar Messages

  • Rollback / savepoint Issue

    Hi,
    I'm a little confused on how the rollback to savepoint works in the database.
    A transaction statement such as Rollback fires an internal commit. Does the command :
    Rollback to savepoint <savepoint name> also issues an implicit commit?
    I did the following which caused all the confusion:
    SQL>commit;
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row isnerted
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row isnerted
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row inserted
    SQL> Savepoint A;
    SQL> Savepoint created
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row inserted
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row inserted
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row inserted
    SQL> Savepoint B;
    SQL> Savepoint created
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row inserted
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row inserted
    SQL> insert into table_name values ('sdf',23,...);
    SQL> 1 Row inserted
    SQL> Savepoint C;
    SQL> Savepoint created
    Now if we do a :
    SQL> Rollback to Savepoint B;
    SQL> Rollback completed
    Would an implicit commit be fired after this statement which would erase all marked savepoints ?
    Because it was possible to do a :
    SQL> Rollback to Savepoint A
    SQL> Rollback Completed

    hi,
    Rollback doesn't implicitly commit anything.
    commit means sth different than rollback.
    When commit,
    All transactions get saved in the database,
    Log maintained
    All locks released
    etc...In Rollback to savepoint,
    Related transaction rollbacked but previous one are still in pending not commited
    related locked released , not all locks which is occured due to previous one.
    etc...hv a nice day,
    Rup

  • Forms savepoints

    Is there any way of tracking savepoint activity in forms ie, determine if savepoints is affecting application performance? The default for oracle form savepoint mode property is on which is the way the application has be created.
    regards

    Forms will always create a savepoint when a new form is opened, and just before the commit process. So the number of savepoints issued depends on those two factors.

  • I/O Wait on LogWriter

    Hi ,
    We are inserting 500K rows into a table and process is taking so long. I think some of the parameters were not set correctly.
    I can see a task status LogIOWait (LogQueue:UserTaskEOTReady) on this process and very few savepoints  were issued even the log is filling up.
    Below numbers are increasing while the processig is running as I believe there were few savepoints issued to write to data area.
    Log Pages written 163,000
    Waiting for Log writer 145,300
    LogIOClusterSize = 8
    LogQueueSize=3000
    MaxSavepointTimeInterval 600
    dbmcli on xdb>info log
    OK
    END    
    Name                            | Value
    Log Mirrored                    = NO
    Log Writing                     = ON
    Log Automatic Overwrite         = OFF
    Max. Size (KB)                  = 8292096
    Backup Segment Size (KB)        = 2796200
    Used Size (KB)                  = 1619952
    Used Size (%)                   = 20
    Not Saved (KB)                  = 1619952
    Not Saved (%)                   = 20
    Log Since Last Data Backup (KB) = 0
    Savepoints                      = 73
    Checkpoints                     = 0
    Physical Reads                  = 0
    Physical Writes                 = 162252
    Queue Size (KB)                 = 24000
    Queue Overflows                 = 851
    Group Commits                   = 0
    Waits for Logwriter             = 145903
    Max. Waits                      = 1
    Average Waits                   = 0
    OMS Log Used Pages              = 0
    OMS Min. Free Pages             = 0
    Please through some guidance on improving the process more efficient.
    DB Version : 7.7.06.10 on Linux 64 bit.
    Thanks
    Naveen

    > I can see a task status LogIOWait (LogQueue:UserTaskEOTReady) on this process and very few savepoints  were issued even the log is filling up.
    When you see a lot of LogIOWait you should check the write I/O performance for the filesystem the log area is stored into.
    A common mistake is to save the log volumes on RAID 5 or similar devices.
    Make sure that this is not the case.
    > Below numbers are increasing while the processig is running as I believe there were few savepoints issued to write to data area.
    The savepoints have nothing to do with the waiting for LogIO.
    They are written when necessary or every ten minutes.
    > Log Pages written 163,000
    > Waiting for Log writer 145,300
    > LogQueueSize=3000
    3000 8K pages of log information can be put into the queue  - that's really a lot, so this is not your problem.
    Anyhow, no DB parameter will make your I/O faster - your storage team will/should.
    Show us your log area setup and check the I/O options used to mount the filesystem.
    Also make double sure that you've got he disks for the log volumes exclusively.
    regards
    Lars

  • Using Close_Form built-in (Forms 6.0)

    I'm experimenting with creating a dialogue controlled within the same session. Essentially I want to create an environment where a user can open numerous forms (i.e. where form A calls form B and form B calls form C) from a head form (form A), while still allowing the user to navigate inbetween all forms and not open duplicate instances of the same form. I'm running into a problem because I want the user to be able to close all child (called) forms from a calling form (i.e. form C closes when a user exits form B). The issue is, using the Close_Form built-in causes a Full Rollback within the session. Hence, if form B calls form C, and C calls form D, exiting form C rolls back data in form B.

    I'm generating forms using Oracle Developer 6.0 > Form Builder.
    I implemented your previous suggestion, unfortunatelyl to no avail. What's the difference between the default savepoint setting in Oracle and when I set a savepoint?
    I feel like the Close_Form built-in should have another parameter regarding the savepoint issue.
    null

  • BC4J Issuing Rollback to Savepoint

    Hi we are having a serious issue with BC4J in our production environment. It issues a Rollback to Savepoint command. The database session that performs the command still has a locks in the database, specifically on the rollback segment.
    When other users then insert/update they must wait for the other session to release it's locks.
    Has anyone else encoutered a similar problem? Workarounds?
    Thanks

    Hi we are having a serious issue with BC4J in our production environment. It issues a Rollback to Savepoint command. The database session that performs the command still has a locks in the database, specifically on the rollback segment.
    When other users then insert/update they must wait for the other session to release it's locks.
    Has anyone else encoutered a similar problem? Workarounds?
    Thanks

  • FRM-40512 ORACLE error: unable to issue SAVEPOINT command

    Anybody, know , how can i to increse the savepoints value in init.ora in 9i ?
    regards.
    MDF

    thanks, sir,
    u have got the point. problem is that the oacle system doesnt kill that session; instead it hold the session. where i could do nothing. and moreover, if i was performing any dml operation then it(oracle system) locks the very records.
    if i log-on next time & want to retrieve & perform the same dml operation again then
    it gives me the message:
    "Resource busy & acquire no wait ........."
    then i have to kill the previous session manually.
    now, please give me a solution where i want to reconnect holding the current session & perform the desire tasks assuming that nothing has happened.
    please give me some examples.
    saiful

  • Use of savepoint and rollback in trigger of forms

    I have a button in forms with next code
    --savepoint   
    SAVEPOINT SAVEP1;
    --Call procedure of BBDD: Changed data of tables
    Packet.procedureexample(..., bResult);
    --If not correct the execution -> rollback to savepoint and exit form
    IF NOT bResult THEN
      ROLLBACK TO SAVEPOINT SAVEP1;
      Exit_Form(NO_VALIDATE);
    END IF;
    -- Othe savepoint
    SAVEPOINT SAVEP2;
    --Call other procedure of BBDD: Changed data of tables
    Packet.procedureexample2(..., bResult);
    --If not correct the execution -> rollback to savepoint and exit form
    IF NOT bResult THEN
      ROLLBACK TO SAVEPOINT SAVEP2;
      Exit_Form(NO_VALIDATE);
    END IF;
    --All correct -> COMMIT
    COMMIT;This question is: if execution of "Packet.procedureexample" is correct, but the execution of "Packet.procedureexample2" isn't correct, what happend with data changed for first procedure (Packet.procedureexample).
    Thnks.

    Hi Jortri,
    If execution of "Packet.procedureexample" is correct, but the execution of "Packet.procedureexample2" isn't correct,
    Nothing will happen to data changed for Packet.procedureexample because it has not yet been committed.
    It's because when you are giving rollback to save point, you've also done Exit_Form(NO_VALIDATE); COMMIT is only at the last.
    Hence, if Packet.procedureexample2" is not correct, it'll roll back to save point 2(SAVEP2) and exit the form without validating.
    Since, commit is not issued till now, whatever data modification were done using Packet.procedureexample, are lost.
    If both of the packages data are independent of each other and you don't want to lose the change then issue a commit before creating second savepoint.
    Hope it helps.
    +Please mark answer as helpful / correct, if it helps you+
    Navnit
    Edited by: Navnit Punj on 17-Jun-2009 02:10

  • How can I get a list of active savepoints for the current session?

    Hi,
    In Oracle Applications, we are getting the following error while performing ROLLBACK to a Savepoint.
    "Unexpected Error: ORA-01086: savepoint 'PTNR_BULK_CALC_TAX_PVT' never establishe d ORA-06510: PL/SQL: unhandled user-defined exception"
    So how can I get a list of active savepoints for the current session?
    Could you please also let me know if there is any better way to debug this issue.
    Appreciate any quick response as the issue is very critical.
    Thanks,
    Soma

    user776523 wrote:
    Hi,
    In Oracle Applications, we are getting the following error while performing ROLLBACK to a Savepoint.
    "Unexpected Error: ORA-01086: savepoint 'PTNR_BULK_CALC_TAX_PVT' never establishe d ORA-06510: PL/SQL: unhandled user-defined exception"It sounds like there's an execution path in the code where the SAVEPOINT is never issued.
    There is no way to get a list of active savepoints. Is this your code or a "canned" procedure? If it is your code you can go through the code looking for answers, possibly tracing execution using DBMS_OUTPUT.PUT_LINE or writing messages to a log table. If its a "canned" procedure you may need to open an SR with Oracle

  • [ADF-11.1.2] Locking issue with SQL 92

    I see one Locking issue with SQL92 Oracle ADF Application.
    ADF Version: [ADF-11.1.2]
    Database: Oracle 10g Express Edition
    Situation 1:
    With Following setting:
    File: Application Resource > Description > ADF META-INF > adf-config.xml
        <startup>
          <amconfig-overrides>
            <config:Database jbo.SQLBuilder="SQL92" jbo.locking.mode="optimistic"/>
          </amconfig-overrides>
        </startup>I have a page showing record 'x' of view object. I open same record on another page. Now I have same record showing on two different tabs of browser.
    1. I modify first record and save it. It worked... Got commited to database.
    2. I goto second tab and modify same record and tried to same it. It throws me an error - Another user has changed the row with primary key oracle.jbo.Key[38 ] . As expected...
    3. I then, reopen the same record on 3rd tab of browser. Modify it and tried to save it. It just hang... as if it is processing the record endlessly.
    If I see the Log:
    <BaseSQLBuilderImpl> <doEntitySelectForAltKey> [312] BaseSQLBuilderImpl Executing doEntitySelect ... (true)
    <BaseSQLBuilderImpl> <doEntitySelectForAltKey> [313] Generating new LOCK statement
    <BaseSQLBuilderImpl> <buildSelectString> [314] Built select: 'SELECT ID, CI_ID, COLUMN_NAME, DISPLAY_COLUMN_NAME, COLUMN_VALUE, CREATE_DATE, CREATE_BY FROM ESUSER.CI_AUDIT'
    <BaseSQLBuilderImpl> <doEntitySelectForAltKey> [315] Executing LOCK "SELECT ID, CI_ID, COLUMN_NAME, DISPLAY_COLUMN_NAME, COLUMN_VALUE, CREATE_DATE, CREATE_BY FROM ESUSER.CI_AUDIT WHERE ID=? FOR UPDATE"
    <BaseSQLBuilderImpl> <bindWhereAttrValue> [316] Where binding param 1: 38
    That's it.. nothing happens further.. If I execute above query on SQL Worksheet, it doesn't come up with the result. Just hang for something...
    SELECT ID, CI_ID, COLUMN_NAME, DISPLAY_COLUMN_NAME, COLUMN_VALUE, CREATE_DATE, CREATE_BY FROM ESUSER.CI_AUDIT WHERE ID='38' FOR UPDATE I can execute above query for other record of same table but not '38'. Even if I fire commit command to database, it is not working.
    I have to restart the database services to bring everything to normal state.
    Situation 2:
    With Oracle as Database :
        <startup>
          <amconfig-overrides>
            <config:Database jbo.SQLBuilder="Oracle" jbo.locking.mode="optimistic"/>
          </amconfig-overrides>
        </startup>Everything is working file. i.e. at step 3, record is getting modified successfully with following log:
    <OracleSQLBuilderImpl> <doEntitySelectForAltKey> [27] OracleSQLBuilder Executing doEntitySelect on: ESUSER.CI_AUDIT (true)
    <ADFLogger> <begin> Entity read all attributes
    <OracleSQLBuilderImpl> <buildSelectString> [28] Built select: 'SELECT ID, CI_ID, COLUMN_NAME, DISPLAY_COLUMN_NAME, COLUMN_VALUE, CREATE_DATE, CREATE_BY FROM ESUSER.CI_AUDIT CIAudit'
    <OracleSQLBuilderImpl> <doEntitySelectForAltKey> [29] Executing LOCK...SELECT ID, CI_ID, COLUMN_NAME, DISPLAY_COLUMN_NAME, COLUMN_VALUE, CREATE_DATE, CREATE_BY FROM ESUSER.CI_AUDIT CIAudit WHERE ID=? FOR UPDATE NOWAIT
    <ADFLogger> <addContextData> Entity read all attributes
    <OracleSQLBuilderImpl> <bindWhereAttrValue> [30] Where binding param 1: 38
    <ADFLogger> <addContextData> Entity read all attributes
    <ADFLogger> <end> Entity read all attributes
    <ADFLogger> <end> Lock Entity
    <ADFLogger> <begin> Before posting the entity's changes
    <ADFLogger> <begin> Updating audit columns
    <ADFLogger> <end> Updating audit columns
    <ADFLogger> <end> Before posting the entity's changes
    <OracleSQLBuilderImpl> <doEntityDML> [31] OracleSQLBuilder Executing, Lock 2 DML on: ESUSER.CI_AUDIT (Update)
    <OracleSQLBuilderImpl> <buildUpdateStatement> [32] UPDATE buf CIAudit>#u SQLStmtBufLen: 210, actual=60
    <OracleSQLBuilderImpl> <doEntityDML> [33] UPDATE ESUSER.CI_AUDIT CIAudit SET COLUMN_VALUE=? WHERE ID=?
    <ADFLogger> <begin> Entity DML
    <OracleSQLBuilderImpl> <bindUpdateStatement> [34] Update binding param 1: cip7ri1
    <OracleSQLBuilderImpl> <bindWhereAttrValue> [35] Where binding param 2: 38
    <ADFLogger> <addContextData> Entity DML
    <ADFLogger> <end> Entity DML
    Can any one please tell me, what is the issue with SQL92 setting ?
    Edited by: Anandsagar Sah on Mar 11, 2012 8:10 AM

    The framework works correctly in the Situation #1. Please, note that the locking statement in this case is "SELECT ... FOR UPDATE", but not "SELECT ... FOR UPDATE NOWAIT" (as it is in the Situation #2). When you entered the 2nd tab and tried to update the row, then the framework executed the locking statement and the row was locked (and it remained locked because the framework detected that another user had modified the row, so it stopped the processing and no COMMIT operation was executed). When you entered the 3rd tab and tried to update the row, then the framework tried to lock the row againg, but the locking statement was blocked by the existign lock and it started waiting on the lock from the 2nd tab. So this is expected behaviour.
    The interesting question is why you do not get any error in the Situation #2. In my opinion you should get an error because the locking statement from the 3rd tab should fail immediately (because the row should have been locked from the 2nd tab and the locking statement is with NOWAIT option). I suspect that when the DB is Oracle and you use Oracle SQLBuilder, then the ADF issues a DB savepoint at the beginning of the DML operation and rolls back to the savepoint is a case of some failure, so the 2nd tab has not left any lock. You can check this by setting on SQL trace on the DB server.
    Dimitar

  • ITunes+QuickTime installation from CD of iPod nano Issue

    During installing the s/w from CD. an error regarding QT was displyed (something to do with files) and later the installation was over. When iTunes is launched get an error "iTunes have encountered problem and needs to be closed". and it asks whether you need to send the report to Microsoft.
    Uninstalled iTunes+QT and tried again but no success. Also tried installing the s/w downloaded from apple website did not get QT installation error but still getting the same MS error. After clicking on the error report, the error signature part shows following information.
    AppName: itunes.exe AppVer: 6.0.1.3 ModName: unknown
    ModVer: 0.0.0.0 Offset: 10001040
    Also tired to find simlar issue on this forum but no luck and hence posting this message.
    Would appreciate help.
    Thanks in advance.

    After reading certain posts I was able to resolve this issue today morning. I have been working on this since yesterday since my new ipod nano was delivered, so about for 15+ hours on and off.
    The problem started when I tried to install s/w from CD. Hence thought of downloading the s/w from the website. That also did not solve the problem. Then started looking at discussions where lot of posts mentioend the similar issue during the same time frame. Uninstalled and reinstalled multiple times. Also went back a week to have my desktops savepoint restored. But no luck.
    Hence when today I found a posting on this site about downloading standalone quicktime, followed that path and what you see, after installing standalone quicktime, iTunes got loaded, was able to see my new ipod nano in itunes and have already uploaded songs on it.
    So whats the lessons learned. Apple still needs to come over the hump of making USER FRIENDLY SOFTWARE ( its that what APPLE is known for?).
    Certainly I never thought that it will be such an exercise to have it installed.

  • Question about Kodo Savepoint

    Hello,
    I tried to use Kodo Savepoint, but met some problems. I think the issue was related to the configuration. Does anybody give some advices?
    With the default Kodo configurations (kodo.SavepointManager=in-mem, kodo.FlushBeforeQueries=true), Kodo reports: “The configured SavepointManager does not support incremental flushing when a savepoint has been set. You must release your savepoints before flushing” while querying from DB after setting save point.
    With Kodo configurations (kodo.SavepointManager=in-mem, kodo.FlushBeforeQueries=false), the save point could be set, rollback to, released successfully. But Kodo reports: “Queries with aggregates or projections using variables currently cannot be executed in-memory. Either set IgnoreCache to true, set the openjpa.FlushBeforeQueries property to true, or execute the query before changing any instances in the transaction” while loading DB schema.
    With Kodo configurations (kodo.SavepointManager=jdbc, kodo.FlushBeforeQueries=true|false), Kodo reports: “An error occurred attempting to invoke JDBC 3 method. Your driver or database may not support JDBC 3 features” while setting save point. The save point was introduced since JDBC 3.0. I can use save point successfully via JDBC client with same oracle JDBC driver and database instance. Still don’t know why this issue reported by Kodo.
    With Kodo configurations (kodo.SavepointManager=oracle, kodo.FlushBeforeQueries= true|false), Kodo reports: “could not set a Savepoint with auto-commit on” while setting save point. And we can’t use oracle SavepointManager because we should support multiple database platform.
    Thanks,
    Alan

    Can someone please respond to the solution of this problem.
         at weblogic.jdbc.common.internal.ConnectionEnv.setup(ConnectionEnv.java:293)
         at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:306)
         at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:468)
         at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:357)
         at weblogic.jdbc.common.internal.ConnectionPoolManager.reserve(ConnectionPoolManager.java:83)
         at weblogic.jdbc.jta.DataSource.getXAConnectionFromPool(DataSource.java:1476)
         at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1274)
         at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:440)
         at weblogic.jdbc.jta.DataSource.connect(DataSource.java:396)
         at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:359)
         at com.solarmetric.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:122)
         at com.solarmetric.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:73)
         at kodo.jdbc.runtime.JDBCStoreManager.connectInternal(JDBCStoreManager.java:906)
         at kodo.jdbc.runtime.JDBCStoreManager.connect(JDBCStoreManager.java:884)
         at kodo.jdbc.runtime.JDBCStoreManager.retainConnection(JDBCStoreManager.java:189)
         at kodo.jdbc.runtime.JDBCStoreManager.begin(JDBCStoreManager.java:114)
         at kodo.runtime.DelegatingStoreManager.begin(DelegatingStoreManager.java:95)
         at kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:1106)
         at kodo.runtime.PersistenceManagerImpl.flushSafe(PersistenceManagerImpl.java:1038)
         at kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:808)
         at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:429)
         at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:335)
         at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:291)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4060)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:3953)
         at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:4467)
         at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    ,currentThread=Thread[[ACTIVE] ExecuteThread: '53' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads],lastUser=null,currentError=null,currentErrorTimestamp=null,t
    This fails in clustered environment but works fine in stand alone.
    Edited by varchitect at 01/18/2008 9:59 AM

  • Issue with logic of in parameter of SP

    Hi,
    below is my SP... user who is running this SP has an option to enter value for P_Step or not. if no value is entered for P_Step then its defaulted to NULL and all steps should run. If the user specifies some value like 10 or 20 or 30 then the SP should jump to that step. How do i do this. Can any one suggest me a logic to jump or some function in oracle that can do this.
    create or replace SP_TEST(P_STEP in number Default NULL)
    as
    V_STEP number;
    Begin
    V_STEP :=P_STEP;
    if V_STEP is null then V_STEP:=10;
    end if;
    --- Here i need some logic to jump steps ---
    V_STEP:=10;
    insert into .........; COMMIT;
    V_STEP:= 20;
    insert into......;  COMMIT;
    V_STEP:=30;
    insert into.....; commit;
    END SP_TEST;Thanks
    Sami

    >
    below is my SP... user who is running this SP has an option to enter value for P_Step or not. if no value is entered for P_Step then its defaulted to NULL and all steps should run. If the user specifies some value like 10 or 20 or 30 then the SP should jump to that step. How do i do this. Can any one suggest me a logic to jump or some function in oracle that can do this.
    >
    In my opinion your architecture is flawed. You are combining command & control with processing.
    There are two main components to processing: 1) command & control and 2) execution. These two components should be implemented separately and not mixed together in one procedure. Mixing them together is not scableable and makes maintenance and updates complex and prone to problems.
    You can easily see why maintenance is an issue by looking at the two previous responses. The ORDER that processing is done is intermixed with the actual processing (INSERT for these examples) that is done. It would be easy to change the wrong query or add a new condition to these solutions without risking breaking something else.
    Command & control - this component determines WHAT units of work (UOW) need to be performed, what order they need to be performed, how to handle exceptions and the basic flow of the entire process. This component often is responsible for the logging of activity at the process level and for controlling the SAVEPOINT/COMMIT/ROLLBACK steps that are required.
    The execution component does just that: executes a SINGLE unit or work, no more and no less. This component takes input about what to do and, often, what to do it on. It reports to it's COMMAND component the execution results. If it performs a COMMIT/ROLLBACK it does so only if it was instructed to do so by the COMMAND component (e.g. by a procedure parameter).
    For your use case you would create separate procedures (likely in a package) for each step. Each of those procedures would execute ONE step and one step only.
    Your current procedure would become your CONTROL procedure. It would determine which of the STEP procedures get called and in what order they get called.
    If you were to use either of the previously posted solutions you should remove the INSERT INTO execution code to new procedures and replace that code with a call to the new procedure. This would separate the COMMAND/CONTROL from the EXECUTION components. Then it would be much easier for anyone (especially a new developer) to make sure they were changing the correct component.
    Your proposed example appears to be an attempt to restart a series of steps that may have failed during the first run. For example, you have a 10 step process, try to run it all and it fails at step 5. So now you need to rerun but start at step 5 since steps 1 thru 4 have already been completed.
    If so then for maximum control and maintainability your CONTROL procedure should determine, at the very beginning, exactly which steps are to be executed.
    NOTE: yes, this may appear to complicate the CONTROL component but it actually makes things a LOT simpler to understand and manage.
    One way to do that is to create a BOOLEAN variable for each step and set it to TRUE if that step should be executed and to FALSE (the default) if not.
    Then use logic similar to what Sg049 provided to execute each step if the flag is set
    v_step10 boolean := false;
    v_step20 boolean := false;
    BEGIN
      -- set the flags based on what steps need to be executed
      IF P_STEP = 'ALL' THEN -- do NOT use NULL as a data value - use something that makes it clear what you mean like ALL (parm is varchar)
         v_step10 := true;
         v_step20 := true;
      ELSIF P_STEP = 'STEP20' THEN
         v_step20 := true;
      END IF;
      -- execute the steps
      IF v_step10 THEN
        BEGIN
           SP_STEP10 (P1, P2, . . .);
        EXCEPTION
        END;
      IF v_step20 THEN
        BEGIN
           SP_STEP20 (P1, P2, . . .);
        EXCEPTION
        END;
    EXCEPTION
    END;Remember - there are NO performance issues in determining WHAT to do. The performance problems, if any, will be in DOING it.
    The above may seem more verbose and it is. But that is what makes it very easy to understand and maintain.

  • Oracle Sandbox issue

    Hi,
    I wanted to create a custom webcenter application which is customizable by users at runtime with sandox feature enabled. And i want save all the changes done at runtime by the users as personalization as the changes must not get reflected for the other users.
    The steps i followed are
    1. Created a webcenter application which uses oracle composer.
    2.Implemented ADF security.
    3.Updated the adf-config file with the required namespaces.
    4.Updated the web.xml file to set the appropriate filter mappings.(order of the filter ServletADFFilter,WebCenterComposerFilter & AdfBindingFilter)
    5.Implemented Custom customization and ComposerSessionOptionsFactory classes.
    6.Registered the classes with Oracle composer in adf-config.xml.
    7.Registered a MDS repository in EM.
    Finally to enable sandbox creation, our application should be configured to use the database store. I'm not sure of how to do this.And also how to make the appplication use the MDS repository registered in EM?.
    Without completing this step the sandbox is not getting enabled in the application and i'm not getting the save button in oracle composer toolbar.
    Please help me resolving the issue.
    Thanks.

    Thanks for your point. I changed the adf-config.xml accordingly as
    <metadata-store-usages>
    <metadata-store-usage id="WebCenterFileMetadataStore"
    default-cust-store="true" deploy-target="true">
    <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
    <property name="jndi-datasource"
    value="jdbc/mds/MyMDSRepository"/>
    <property name="partition-name" value="MyMDSPartition"/>
    </metadata-store>
    </metadata-store-usage>
    </metadata-store-usages>
    But when i create an EAR file of my application,the adf-config.xml in the EAR file doesn't have the <metadata-store class-name> tag in the file.Its missing.
    The <metadata-store-usuages> tag in adf-config.xml of the EAR file
    <metadata-store-usages><metadata-store-usage default-cust-store="true" deploy-target="true" id="WebCenterFileMetadataStore"/></metadata-store-usages>
    Also when i start my integrated weblogic server i get the following exceptions
    oracle.mds.internal.lcm.exception.ValidationException: MDS-05790: The metadata store definition is either missing or incorrectly specified in the application configuration.
    oracle.mds.config.MDSConfigurationException: MDS-01335: namespace "/xliffBundles" mapped to metadata-store-usage "WebCenterFileMetadataStore" but its definition was not found in MDS configuration.
    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    My adf-config.xml file for reference
    <?xml version="1.0" encoding="windows-1252" ?>
    <adf-config xmlns="http://xmlns.oracle.com/adf/config"
    xmlns:adf="http://xmlns.oracle.com/adf/config/properties"
    xmlns:mdsC="http://xmlns.oracle.com/adf/mds/config">
    <adf:adf-properties-child xmlns="http://xmlns.oracle.com/adf/config/properties">
    <adf-property name="adfAppUID" value="MDS1-7151"/>
    </adf:adf-properties-child>
    <adf-resourcebundle-config xmlns="http://xmlns.oracle.com/adf/resourcebundle/config">
    <applicationBundleName>resourcebundles/xliffBundles/MDS1OverrideBundle</applicationBundleName>
    <bundleList>
    <bundleId override="true">oracle.adf.view.page.editor.resource.ComposerOverrideBundle</bundleId>
    </bundleList>
    </adf-resourcebundle-config>
    <page-editor-config xmlns="http://xmlns.oracle.com/adf/pageeditor/config">
    <session-options-factory>view.AppsSessionOptionsFactoryImpl</session-options-factory>
    <sandbox-namespaces>
    <namespace path="/pages"/>
    <namespace path="/pageDefs"/>
    </sandbox-namespaces>
    </page-editor-config>
    <adf-security-child xmlns="http://xmlns.oracle.com/adf/security/config">
    <JaasSecurityContext initialContextFactoryClass="oracle.adf.share.security.JAASInitialContextFactory"
    jaasProviderClass="oracle.adf.share.security.providers.jps.JpsSecurityContext"
    authorizationEnforce="true"
    authenticationRequire="true"/>
    </adf-security-child>
    <adf-controller-config xmlns="http://xmlns.oracle.com/adf/controller/config">
    <adf-scope-ha-support>true</adf-scope-ha-support>
    <enable-grammar-validation>true</enable-grammar-validation>
    <enable-implicit-savepoints>false</enable-implicit-savepoints>
    </adf-controller-config>
    <mdsC:adf-mds-config version="11.1.1.000">
    <mds-config xmlns="http://xmlns.oracle.com/mds/config">
    <persistence-config>
    <metadata-namespaces>
    <namespace path="/oracle/adf/rc/metadata"
    metadata-store-usage="WebCenterFileMetadataStore"/>
    <namespace path="/persdef/"
    metadata-store-usage="WebCenterFileMetadataStore"/>
    <namespace path="/resourcebundles/"
    metadata-store-usage="WebCenterFileMetadataStore"/>
    <namespace path="/xliffBundles/"
    metadata-store-usage="WebCenterFileMetadataStore"/>
    <!-- Your jspx customizations alone go here -->
    <namespace path="/pages"
    metadata-store-usage="WebCenterFileMetadataStore">
    <namespace-restriction type="CUSTOMIZATIONS"/>
    </namespace>
    <!-- Your pagedef customizations alone go here -->
    <namespace path="/pageDefs"
    metadata-store-usage="WebCenterFileMetadataStore">
    <namespace-restriction type="CUSTOMIZATIONS"/>
    </namespace>
    </metadata-namespaces>
    <metadata-store-usages>
    <metadata-store-usage id="WebCenterFileMetadataStore"
    default-cust-store="true" deploy-target="true">
    <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
    <property name="jndi-datasource"
    value="jdbc/mds/MyMDSRepository"/>
    <property name="partition-name" value="MyMDSPartition"/>
    </metadata-store>
    </metadata-store-usage>
    </metadata-store-usages>
    </persistence-config>
    <cust-config>
    <match>
    <customization-class name="oracle.adf.share.config.UserCC"/>
    </match>
    </cust-config>
    <cache-config>
    <max-size-kb>100000</max-size-kb>
    </cache-config>
    </mds-config>
    </mdsC:adf-mds-config>
    <adf-faces-config xmlns="http://xmlns.oracle.com/adf/faces/config">
    <persistent-change-manager>
    <persistent-change-manager-class>
    oracle.adf.view.rich.change.MDSDocumentChangeManager
    </persistent-change-manager-class>
    </persistent-change-manager>
    <taglib-config>
    <taglib uri="http://xmlns.oracle.com/adf/faces/customizable">
    <tag name="showDetailFrame">
    <persist-operations>
    all
    </persist-operations>
    <attribute name="expansionMode">
    <persist-changes>
    true
    </persist-changes>
    </attribute>
    <attribute name="contentStyle">
    <persist-changes>
    true
    </persist-changes>
    </attribute>
    </tag>
    <tag name="panelCustomizable">
    <persist-operations>
    all
    </persist-operations>
    </tag>
    </taglib>
    <taglib uri="http://xmlns.oracle.com/adf/pageeditor">
    <tag name="layoutCustomizable">
    <attribute name="type">
    <persist-changes>
    true
    </persist-changes>
    </attribute>
    </tag>
    </taglib>
    </taglib-config>
    </adf-faces-config>
    </adf-config>
    So, still the problem persists.I'm not able to enable the sandbox for my application.
    Thanks.
    Edited by: user12952392 on May 28, 2010 7:02 AM

  • Create savepoint failing

    Hi,
    I am trying to create a savepoint programmatically in my flow as follows:
    public String saveTaskFlow() {
    ControllerContext cc = ControllerContext.getInstance();
    if (cc != null) {
    SavePointManager mgr = cc.getSavePointManager();
    if (mgr != null) {
    String id = mgr.createSavePoint();
    System.out.println("Save point is being set " + id);
    When i run my flow i am getting an exception saying:
    <Feb 28, 2012 1:29:26 AM PST> <Warning> <oracle.adfinternal.view.faces.lifecycle.LifecycleImpl> <BEA-000000> <ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase INVOKE_APPLICATION 5
    javax.faces.el.EvaluationException: javax.el.ELException: oracle.adfinternal.controller.savepoint.SavePointException: ADFC-08018: The ADF Controller is unable to create or execute a SQL statement: 'CREATE TABLE "ORADFCSAVPT" (SAVE_POINT_ID VARCHAR2(64 CHAR) NOT NULL,CREATED DATE DEFAULT SYSDATE NOT NULL,OWNER_ID VARCHAR2(64 CHAR),VERSION VARCHAR2(20 CHAR),DESCRIPTION VARCHAR2(250 CHAR),EXPIRE_DT DATE,SAVE_POINT BLOB, PRIMARY KEY (SAVE_POINT_ID))STORAGE (MAXEXTENTS UNLIMITED)LOB (SAVE_POINT) STORE AS (ENABLE STORAGE IN ROW CHUNK 4096 CACHE)'.
    at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:58)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
    at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:93)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
    Basically it is failing at the table creation.
    I manually created the table using the same sql command, but even then i am facing this exception.
    I followed the configurations mentioned in http://docs.oracle.com/cd/E21764_01/web.1111/b31974/taskflows_complex.htm#CHDBDJBI
    Any clues on why this can be failing?

    This sounds like a database issue. Hence, this is far easier to solve using SQL*Plus rather then through WLS.
    Please login to SQL*Plus, generate the error, and post the error here.

Maybe you are looking for

  • Help!!!Cannot update firmware N95 v20 to v21

    Could anyone help me with this problem i've installed NSU and nokia pc suite(all latest..) i've plug the my n95(v20), detected by PC suite... i run NSU,, detected,,, and downloaded v21 firmware for n95 (112mb).. after it finished downloading, when it

  • Use of prompted hierarchy's base members in Script Logic

    Hello all, I have a data manager package which prompts the user for a dimension called P_BUDGET_MODEL. The prompt is SELECT hence the user selects a hierarchy node on this dimension. In the relevant Script Logic I have a variable %P_BUDGET_MODEL_SET%

  • Has anyone managed to output analog RGB to Sony BVM HD CRT?

    We are working on conforming 2K full DI features. We need HD monitoring, so I tried to connect second output of ATI X1900XT to Sony HD BVM monitor with analog RGB and composite sync. I downloaded the demo of the application called "DisplayConfigX" fr

  • Problen with error-page in web-app

    Hi! Anybody got working <error-page> in <web-app>? As I can see, oc4j (1.0.2.2.1) forgots about contentType and sets application/jsp mime type for error page... null

  • HT4583 how to add a app box

    If you have a 16g ipad and you can't store any movis on it or up grade you apps what do you do; Do you deleat the stuff you all ready payd for we have 25g in the cloud