Reporting of deferred constraint failures

Hello
I'm running Kodo 3.1.4 in WebLogic 8.1 against Oracle 9. I'd like to run
with deferred constraints but there are problems reporting failures of
these constraints: the database rolls back but no exception is thrown by
weblogic or KoDo. The user is therefore presented with a silent failure
(though the correct exception is written into the weblogic container log).
Running with DataSourceMode set to enlisted (rather than local) produces
the expected exceptions when constraints fail but the constraints are no
longer correctly deferred (they are tested after each statement).
I'm all out of ideas. Can anyone point me in the right direction?
TIA
Robert

There should be some sort of client exception... are you sure that you
are not consuming it? Are you using a WL datasource?
Robert Donkin wrote:
Hello
I'm running Kodo 3.1.4 in WebLogic 8.1 against Oracle 9. I'd like to run
with deferred constraints but there are problems reporting failures of
these constraints: the database rolls back but no exception is thrown by
weblogic or KoDo. The user is therefore presented with a silent failure
(though the correct exception is written into the weblogic container log).
Running with DataSourceMode set to enlisted (rather than local) produces
the expected exceptions when constraints fail but the constraints are no
longer correctly deferred (they are tested after each statement).
I'm all out of ideas. Can anyone point me in the right direction?
TIA
Robert--
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com

Similar Messages

  • Reporting exceptions on deferred constraints

    Is it possible to report exceptions on deferred constraints? I am using this mechanism to load tables in an arbitrary order and to prevent FK violations whilst loading.
    As a starting point, the script below works as expected (enabling and disabling):
    CREATE TABLE EXCEPTIONS
    ( ROW_ID ROWID
    , OWNER VARCHAR2(30)
    , TABLE_NAME VARCHAR2(30)
    , CONSTRAINT VARCHAR2(30)
    CREATE TABLE EMP( ENAME VARCHAR2(10));
    ALTER TABLE EMP ADD CONSTRAINT EMP_UK UNIQUE (ENAME) DEFERRABLE;
    ALTER TABLE EMP DISABLE CONSTRAINT EMP_UK;
    INSERT INTO EMP VALUES ('SMITH');
    INSERT INTO EMP VALUES ('SMITH');
    ALTER TABLE EMP ENABLE CONSTRAINT EMP_UK EXCEPTIONS INTO EXCEPTIONS;
    SELECT * FROM EXCEPTIONS;
    However, I don't want to disable constraints, because the application may be performing DML in another session.
    So in the script below I'm deferring the constraints instead of disabling them. But how can I report the constraint violations in this scenario?
    CREATE TABLE EXCEPTIONS
    ( ROW_ID ROWID
    , OWNER VARCHAR2(30)
    , TABLE_NAME VARCHAR2(30)
    , CONSTRAINT VARCHAR2(30)
    CREATE TABLE EMP( ENAME VARCHAR2(10));
    ALTER TABLE EMP ADD CONSTRAINT EMP_UK UNIQUE (ENAME) DEFERRABLE;
    ALTER SESSION SET CONSTRAINTS=DEFERRED;
    INSERT INTO EMP VALUES ('SMITH');
    INSERT INTO EMP VALUES ('SMITH');
    -- Which statement goes here to report constraint violations?
    SELECT * FROM EXCEPTIONS;
    The statement:
    SET CONSTRAINTS ALL IMMEDIATE;
    will validate deferred constraints and result in a SQL Error: ORA-00001: unique constraint (SCOTT.EMP_UK) violated
    But this does not tell me the rows.
    The statement:
    ALTER TABLE EMP ENABLE CONSTRAINT EMP_UK EXCEPTIONS INTO EXCEPTIONS;
    results in the following error, and no rows in the exceptions table:
    SQL Error: ORA-02091: transaction rolled back
    ORA-00001: unique constraint (SCOTT.EMP_UK) violated
    Is there any way to report the violations?
    At the end, I'd like to report ALL violating rows to the user.
    The best I can come up with is, for each constraint perform:
    SET CONSTRAINT EMP_UK IMMEDIATE;
    and in the exception handler explicitly query for duplicates in the table:
    SELECT ENAME FROM EMP GROUP BY ENAME HAVING COUNT(*) > 1;
    I hope there is a better way.

    I believe this will not be usable in a scenario in which the tables are loaded in the "wrong" order. The database will only be consistent after all tables have been loaded. Using DML error logging will produce false errors. Please correct me if I'm wrong.

  • Deferred constraints &  XAExceptions details

    When executing an XA transaction on Oracle 8i with a J2EE server, we are not getting enough details in the OracleXAException that occurs as a result of a deferred constraint being violated (during the commit).
    We're getting a oracle.jdbc.xa.OracleXAException (wrapped inside a TransactionRolledBackException), and upon further inspection I can call the OracleXAException methods:
    getOracleError() : int
    getOracleSQLError() : int
    I cannot get any textual details about the error (ie. which constraint was violated).
    Do other version of Oracle provide more details during XA transaction failures?
    Thanks,
    M

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by SAMEER DESHPANDE ([email protected]):
    Hello
    I would like to know the use of Deferred Constraints.
    At the time of COMMMIT, the Oracle ROLLBACKS the transaction if I set "SET CONSTRAINT ALL DEFERRED;"...
    What is the use of DEFERRED CONSTRAINTS...?
    Thanks
    Sameer<HR></BLOCKQUOTE>
    You can do "SET CONSTRAINT ALL IMMEDIATE" before committing. That statement will raise an error, without rolling back the transaction, if there are violated constraints.

  • Deferred Constraints - error on inserting

    Hi there,
    i've got a very courios problem with deferred constraints. My table creates are:
    CREATE TABLE mitglied
    ( svnr NUMBER(10) NOT NULL,
      instr VARCHAR(20) NOT NULL,
      CONSTRAINT mitglied_pk PRIMARY KEY (svnr));
    CREATE TABLE abteilung
    ( instr VARCHAR(20) NOT NULL,
      geleitetVon NUMBER(10) NOT NULL,
      stvVon NUMBER(10) NOT NULL,
      CONSTRAINT abteilung_pk PRIMARY KEY (instr),
      CONSTRAINT abteilung_geleitetVon_fk FOREIGN KEY (geleitetVon)
                 REFERENCES mitglied(svnr) INITIALLY DEFERRED DEFERRABLE,
      CONSTRAINT abteilung_stvVon_fk FOREIGN KEY (stvVon)
                 REFERENCES mitglied(svnr) INITIALLY DEFERRED DEFERRABLE);
    ALTER TABLE mitglied
      ADD CONSTRAINT mitglied_fk FOREIGN KEY (instr)
                     REFERENCES abteilung(instr) INITIALLY DEFERRED DEFERRABLE;My Inserts (from sql-file):
    INSERT INTO mitglied VALUES ('1833040984', 'Edwin Neugebauer', '1984', '20-JAN-2005', 'Posaune');
    <all of the other "mitglied"-inserts>
    INSERT INTO abteilung VALUES ('Posaune', '1833040984', '1512101070');
    <all of the other "abteilung"-inserts>
    COMMIT;The Error msg:
    Error starting at line 79 in command:
    INSERT INTO mitglied VALUES ('1833040984', 'Edwin Neugebauer', '1984', '20-JAN-2005', 'Posaune')
    Error report:
    SQL Error: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (U0426435.MITGLIED_FK) violated - parent key not found
    (it's the same for all of the other mitglied-inserts), and of course, I get also errors on the abteilung-inserts.
    I've already tried to solve this problem by using "SET AUTOCOMMIT OFF" in sqlplus, but that wasn't the point.
    What's wrong with my Constraints?

    Please post a complete example cut-n-paste from SQL*Plus window that shows the exact output step by step (as like below).
    It apparently works for me as shown below.
    SQL> CREATE TABLE mitglied
      2  ( svnr NUMBER(10) NOT NULL,
      3    mName VARCHAR(30) NOT NULL,
      4    gJahr INTEGER NOT NULL,
      5    aDat DATE NOT NULL,
      6    instr VARCHAR(20) NOT NULL,
      7    CONSTRAINT mitglied_pk PRIMARY KEY (svnr));
    Table created.
    SQL> CREATE TABLE abteilung
      2  ( instr VARCHAR(20) NOT NULL,
      3    geleitetVon NUMBER(10) NOT NULL,
      4    stvVon NUMBER(10) NOT NULL,
      5    CONSTRAINT abteilung_pk PRIMARY KEY (instr),
      6    CONSTRAINT abteilung_geleitetVon_fk FOREIGN KEY (geleitetVon)
      7               REFERENCES mitglied(svnr) INITIALLY DEFERRED DEFERRABLE,
      8    CONSTRAINT abteilung_stvVon_fk FOREIGN KEY (stvVon)
      9               REFERENCES mitglied(svnr) INITIALLY DEFERRED DEFERRABLE);
    Table created.
    SQL> ALTER TABLE mitglied
      2    ADD CONSTRAINT mitglied_fk FOREIGN KEY (instr)
      3                   REFERENCES abteilung(instr) INITIALLY DEFERRED DEFERRABLE;
    Table altered.
    SQL> INSERT INTO mitglied VALUES ('1833040984', 'Edwin Neugebauer', '1984', to_date('20-JAN-2005', 'dd-mon-yyyy'), 'Posaune');
    1 row created.
    SQL> INSERT INTO abteilung VALUES ('Posaune', '1833040984', '1512101070');
    1 row created.
    SQL> commit ;
    commit
    ERROR at line 1:
    ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (OPS$LAPTOP\KKISHORE.ABTEILUNG_STVVON_FK)
    violated - parent key not found
    SQL>Message was edited by:
    Kamal Kishore

  • Influence of deferred constraint to Table is mutating proble

    Hello,
    i have a question regarding the 'Table is mutating,
    Trigger/Function may not see it'-problem. I
    wondered whether a deferrable constraint can solve the problem,
    but as I tested it, it's the same
    behaviour as before.
    Situation:
    assume tables LOC_TO and TORDER and the following constraint:
    ALTER TABLE LOC_TO ADD (CONSTRAINT LT_TOID FOREIGN KEY (LT_TOID)
    REFERENCES TORDER ON DELETE CASCADE
    DEFERRABLE INITIALLY DEFERRED);
    assume a trigger on table TORDER:
    create or replace trigger tIU_TORDER_ADD
    after insert or update of TO_STATE on TORDER
    for each row
    declare
    begin
    insert
    into loc_to
    ( lt_locid,
    lt_toid )
    values
    ( 'HRL14042',
    :new.to_id )
    end tIU_TORDER_ADD;
    I thought, that on a deferred constraint at the triggered action
    no check to TORDER is done, and
    that this fact will prevent the ORACLE_ERROR ORA-04091.
    Can anyone tell me, why this doesn't work?
    Thanks
    Titus Leskien
    null

    There was a loophole in the mutating table gotcha: single row inserts in a BEFORE EACH ROW trigger were not considered mutating, but were in AFTER EACH ROW triggers. This did not apply to INSERT INTO ... SELECT ... statements, which always mutated, even if they only inserted one row.
    This is get-out is no longer included in the documentation, but as you have found still applies in the 9.2 database (and it's unlikely Oracle will have broken it in 10g).
    Cheers, APC

  • Problem "The OLE DB provider for linked server reported an error. The provider reported an unexpected catastrophic failure Cannot fetch a row from OLE DB provider for linked server"

    hi
      i'd like to ask question about linked server.
      my linked server used to work but now when i try to select from linked server i was told "The OLE DB provider for linked server reported an error. The provider reported an unexpected catastrophic failure Cannot fetch a row from OLE DB provider
    for linked server"
      but in fact for test connection i was told "the test connection to the linked server succeeded".
      could  anyone help me? thank u very much
    best regards
    martin

    Hi, 
    In addition to Tracy's post we have to know those answers as well:
    * what provider are you using for the connection
    * what do you connect to
    for example, if someone try to connect to oracle using sql server provider then several simple queries are going to work probably OK, but once you are trying to use T-SQL or any complex SQL query then the errors are starting.
    please post the connection string (without the password!) + the query that you are trying to use.
    [Personal Site] [Blog] [Facebook]

  • Deferred Constraints

    Hi,
    One of our projects is using Kodo to link Java to the Oracle db I works fine with 8.1.7 but we need to connect to a Lite db.
    Kodo is running this query which fails because Oracle Lite does not have a DEFERRED column in the ALL_CONSTRAINTS table. I can't find any info on deferred constraints in Lite.
    Does Lite handle constraints in the same way?
    Is there a workaround ?
    Peter
    SELECT t2.OWNER AS PKTABLE_SCHEM,
    t2.TABLE_NAME AS PKTABLE_NAME,
    t2.COLUMN_NAME AS PKCOLUMN_NAME,
    t0.OWNER AS FKTABLE_SCHEM,
    t0.TABLE_NAME AS FKTABLE_NAME,
    t0.COLUMN_NAME AS FKCOLUMN_NAME,
    t0.POSITION AS KEY_SEQ,
    DECODE (t1.DELETE_RULE,
    'NO ACTION', 3,
    'RESTRICT', 1,
    'CASCADE', 0,
    'SET NULL', 2,
    'SET DEFAULT', 4) AS DELETE_RULE,
    t0.CONSTRAINT_NAME AS FK_NAME,
    DECODE (t1.DEFERRED,
    'DEFERRED', 5,
    'IMMEDIATE', 6) AS DEFERRABILITY
    FROM ALL_CONS_COLUMNS t0,
    ALL_CONSTRAINTS t1,
    ALL_CONS_COLUMNS t2
    WHERE t0.OWNER = t1.OWNER
    AND t0.CONSTRAINT_NAME = t1.CONSTRAINT_NAME
    AND t1.CONSTRAINT_TYPE = 'R'
    AND t1.R_OWNER = t2.OWNER
    AND t1.R_CONSTRAINT_NAME = t2.CONSTRAINT_NAME
    AND t0.POSITION = t2.POSITION;

    Peter,
    Please let us know if you still need help with this post.
    Thank you.

  • EjbRemove fails with deferred constraints in 8.1.6

    I get a constraint violation under certain conditions from Oracle.
    IBM ejb container hides the exception, and raises a CSI_ROLLBACK exception. The only workaround I can think of, is disabling all constraints in Oracle, and trusting IBMs Application server to guarantee the
    referential integrity of the database.
    Does anyone else notice these problems and found a resolution?
    Oracle introduced deferred constraints to allow the constraint violation checking at the end of an transaction.
    For the IBM implementation of entity EJBs this is essential,
    because any the "DELETE FROM WHERE id=" which result from an ejbRemove() happens >>>before<<< an ejbStore() which results in "UPDATE SET foreignkey = NULL ".
    I am using the jdbc driver from classes12.zip, and noticed that
    you get an constraint violation on a commit, when the record has been created in a transaction, is updated in a transaction, and then is deleted in a transaction. The transactions are isolated.
    A rollback, and deleting again resolves the problem.
    But the problem is that an Websphere Application server is in between the
    delete from a user, and the jdbc driver accessed through a datasource.
    null

    Does anyone know where to configure and find required settings (e.g. the number of open_cursors) for Oracle 8.1.6 server when using the jdbc thin driver ?
    null

  • Status=Deferred (temporary failure) with mail stuck in queue

    Adding the "domainname.com" (as in [email protected]) to local host aliases solved the "Mail loops back to myself" bounce message.
    At least mail is being received, but...
    now is piling up in queue.
    I've already tried restarting the queue, no change.
    [SMTP LOG]
    May 5 12:39:31 alpha postfix/pipe[22148]: 1F5A09C1B9: to=<[email protected]>, relay=cyrus, delay=2, status=deferred (temporary failure)
    [MAIL ACCESS LOG]
    May 5 13:06:00 alpha lmtpunix[22527]: AOD: user opts: looking up user record: rbird
    May 5 13:06:00 alpha lmtpunix[22527]: AOD: getting mail attribute for user: rbird
    May 5 13:06:00 alpha lmtpunix[22527]: AOD: mail enabled
    May 5 13:06:00 alpha lmtpunix[22527]: AOD: mbrcheck_servicemembership with accessallservices
    May 5 13:06:00 alpha lmtpunix[22527]: AOD: mail service ACL NOT enabled
    May 5 13:06:00 alpha lmtpunix[22527]: couldn't create stage directory: /var/spool/imap/stage./: File exists
    May 5 13:06:00 alpha lmtpunix[22527]: IOERROR: creating message file /var/spool/imap/stage./22527-1146848760-0: File exists

    Problem solved. It was the finder copy of the mailbfr files from the old server to the new server before I issued the mailbfr restore command.
    I restored an older backup of the database that was already on the SUPERDUPER image, and everything is working now.
    Today's lesson.. Do not use FINDER copy to move mailbfr backups from one machine to another.
    Mike

  • RPE-02175: Internal Error: Uniqeness constraint failure.

    Hi
    Has anyone seen this error before, any advice on how to get round it.
    RPE-02175: Internal Error: Uniqeness constraint failure.  The key P35_V_EMAIL_RCNCLE_SUBJECT_WEB is not unique. Please contact Oracle Support with the stack trace and details on how to reproduce it.
    It occurs when I try to deploy a process flow. I've tried dropping the process flow through the Control Centre but get an API error. If I try to CREATE the process flow I get the above error.
    Cheers
    Si

    Resolved, deleted variables, deployed process flow, recreated variables, deployed process flow.
    Cheers
    Si

  • Feedback deferred constraint is incorrect in sql developer 2.1.0.63.41

    In the earlier 2.1.0.63 the set contraint didnt work entirely in sql developer.
    In this new release the set constraint can be executed and it works, however when you violate a constraint there is no feed back.
    example:
    I create the following table and insert 2 rows
    CREATE TABLE d_orafout
    ( code NUMBER CONSTRAINT d_codepk PRIMARY KEY DEFERRABLE,
    message VARCHAR2(50))
    INSERT INTO d_orafout VALUES(904,'invalid table name')
    INSERT INTO d_orafout VALUES(903,'invalid column name')
    Then i execute:
    set constraint d_codepk deferred;
    set succeeded.
    Then an update that violates the primary key:
    update d_orafout set code = 903 where message = 'invalid table name';
    1 rows updated
    Then when i commit i should get the following error (which works fine in SQL*Plus):
    ORA-02091: transaction rolled back
    ORA-00001: unique constraint (NWG806.D_CODEPK) violated
    However the commit gives me the following output:
    commit;
    commited
    The transaction is not commited, it is rolledback but i dont get the error i need.

    Hi <please supply your name>,
    Thanks for this feedback,
    I have replicated this issues and I have logged a bug.
    Bug 9201183 - COMMIT REPORTING COMMIT INCORRECTLY WHEN USED WITH SET CONSTRAINT DEFERRED
    Regards,
    Dermot.
    SQL Developer Team

  • Run report --- Integration Error ----SSL failure

    I have a form that call a report through the Run_Product Built, this works fine on Developer 6 version, but after I upgraded to 6i, everytime I press the buttonn that call the report, an error message will appear that say "FRM-41211 Integration Error SSL failure running another product" after the Report Background Engine appeared. And the report will not start.
    But if I press the button again, all will be fine.
    Does anyone know what happens ?
    PLease help!!!!

    It is a bug in Forms 6i and possible workaround (from Metalink) is:
    WORKAROUND as follows :
    This brings up the Background Engine on startup and minimizes it.
    1. Create a shortcut for rwrbe60.exe and do a CTRL+C to copy it.
    2. Right click on the TASK BAR at the bottom of the screen and get the TASKBAR
    Properties box up.
    3. Select ADVANCED
    4. Expand Tree for PROGRAMS.
    5. Click of STARTUP folder.
    6. Do a CTRL+V to Paste in the Shortcut to rwrbe60.exe.
    7. Right Click on Shortcut and select Properties.
    8. Click Shortcut Tab.
    9. Make sure of the following fields are as follows:
    TARGET : {drive}:\{path}\rwrbe60.exe /c
    START IN : Is the location of your Reports and Forms.
    SHORTCUT KEY : None
    RUN : MINIMIZED

  • LSMW - Report to get IDOC failures and its external reference number

    Hi All,
    I'm currently using LSMW for data migration in CRM, for Business Partner and transaction data.
    I need to generated a report which covers the idocs which have failed and the external identifier for which it has failed. Currently the IDOC reports that are available OOB provide the IDOC number and the reason for failure. It will be great if I can get the external identifier of the transaction as well.
    I searched for a report in SAP but could not find any which gives this functionality.
    Please advice.
    Thanks in advance.

    Hi,
    1.)If you want the ouput in the same report program which triggers the idoc, it is better to use the control record information.
    You will get IDoc Number from XEDIDC(check the below code) and you can store the idoc number into an internal table if more idoc is expecting to be triggered.
         call function 'MASTER_IDOC_DISTRIBUTE'
              exporting
                MASTER_IDOC_CONTROL        = EDIDC
              tables
                COMMUNICATION_IDOC_CONTROL = XEDIDC
                MASTER_IDOC_DATA           = XEDIDD
              exceptions
                others                     = 5.
       read table xedidc index 1.
      append xedidc-docno to it_docno.
    And finallly use this to display in the output.
    2.) if u want it in a seperate report, then select based on date, idoctype, messagetype
    Regards,
    Sajith

  • Test report must filter test failures to top of report.

    Hello All,
    I currently run lots of small labview tests and generate a long HTML report with the results. Engineers are requesting the failures filter to the top of the report as they want to quickly see the fails. I am hoping this functionality can be set from testand without having to rejig each test in the test suite.
    Advice appreciated.
    Regards
    Chris

    Hi,
    Another way is to modify the "Failure chain" list in the UUT header so that it displays all failed steps.
    See http://zone.ni.com/devzone/conceptd.nsf/webmain/4DF435CA73213F7C86256A56006CA55E. This example describes howtoo for TS 2.0. I've done it with TS 3.1 also.
    Message Edited by Virinco-TomC on 08-26-2006 01:01 PM
    Regards
    Tom Andres Lomsdalen, CTD

  • My computer is reporting a hard disk failure. what to do?

    My hard disk is reporting a failure (Disk Name Toshiba MK6465G4x ATA Device) on my  HP Pavilion dv6 Notebook PC (64 bit OS) which uses windows 7 home premium.  When I run a hard disk check, it fails (failure M11V51-55V5Q8-XD003G-60E803).  ANY SUGGESTIONS?

    Unfortunately with that fail code, no it can not be fixed. Some fail codes indicate a recovery can be run or the check disc might fix it, but not with this fail code.
    I work for HP.

Maybe you are looking for