Hanging with a ROWID and INSERT

camdebuck

Member²
The problem that I am about to detail works fine in the 3.3.1 version of DOA. I'm trying to upgrade to the lastest version, but am having this some problem:

I've created a very simply debug app. Contains one unit with a TOracleSession, TOraclewwDataSet, TwwDataSource, and a TwwDBGrid.

The DDL for the table is as follows:

CREATE TABLE ACG.USERDATSECPROFILE
(
USERDATSECPROFILEID NUMBER(10) NOT NULL,
USERID NUMBER(10) NULL,
SECURITYPROFILEID NUMBER(10) NULL
);

Contains the following trigger (which shouldn't make any difference):

CREATE OR REPLACE TRIGGER ACG.USERDATSECPROFILE_PK_TRG
BEFORE INSERT
ON ACG.USERDATSECPROFILE
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
BEGIN
IF (:new.USERDATSECPROFILEID IS NULL) THEN
SELECT USERDATSECPROFILE_SEQ.NextVal INTO :new.USERDATSECPROFILEID FROM dual;
END IF;
END;
/

The TOraclewwDataSet has the following SQL:

SELECT ROWID, USERDATSECPROFILE.* FROM ACG.USERDATSECPROFILE
WHERE USERID = :USERID

I've defined "USERID" as a Float.

I've set the Sequence Field to the appropriate sequence and column name.

When I insert a new record and then try to post to the database, it goes into never never land.

Again, this works fine under version 3.3.1, but doesn't with the lastest version.

I can post the test app if you would like to see it. Just let me know where to send (as I can't see how to attach to here).

Help!! Thanks.
 
There is also one additional trigger. If I delete this trigger, then the delphi app works fine. However, if it is in place, then it hangs. As I mentioned earlier, version 3.3.1 of DOA works fine. However, version 3.4.6.4 hangs and never comes back.

Here is the trigger:

CREATE OR REPLACE TRIGGER ACG.USERDATSECPROFILE_IU_TR
BEFORE INSERT OR UPDATE ON ACG.USERDATSECPROFILE
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
DECLARE
vInvalidSecurity BOOLEAN;
/******************************************************************************
NAME: USERDAT_IUD
PURPOSE: To make sure that only certain people have access to certain
security profiles.

REVISIONS:
Ver Date Author Description
--------- ---------- --------------- ------------------------------------
1.0 08/05/02 Cam DeBuck 1. Created this trigger.

******************************************************************************/
BEGIN
vInvalidSecurity := FALSE;

-- GLobal System Administrators (Restricted Access) Valid USERID's
IF ((:NEW.SECURITYPROFILEID = 1000114) AND (:NEW.USERID NOT IN (728,832,936,1829,1000540,1000542,1000704,1001126,1001148,1001645))) THEN
vInvalidSecurity := TRUE;
END IF;

-- Developer Access Valid USERID's
IF ((:NEW.SECURITYPROFILEID = 2) AND (:NEW.USERID NOT IN (82,81,85,260,339,357,338,1000406,1000478,1000823,1000899))) THEN
vInvalidSecurity := TRUE;
END IF;

-- US Compliance Country Change (Restricted)
IF ((:NEW.SECURITYPROFILEID = 20) AND (:NEW.USERID NOT IN (81,1000780,661,1190,1718,1996,1944,1001780))) THEN
vInvalidSecurity := TRUE;
END IF;

-- Set them to NO ACCESS
IF vInvalidSecurity THEN
:NEW.SECURITYPROFILEID := 1000132;
END IF;
END USERDAT_IU_TR;
/
 
Hi,

DOA inserts using RETURNING ROWID INTO ... clause if you don't specify key fields in OracleDataSet. There is a bug with it in Oracle 9iR2, but usually this bug produces ORA-600 or ORA-7445 error. Try to run insert statement from SQL*PLUS and see if there is a problem.

You can see exactly the sql command using debug property of OracleDataSet.

Regards,
Alex
 
No, there is no problem inserting using SQL Plus. Only with the current version of DOA does it lock up (older version of DOA works fine on the same database).

Any other suggestions?
 
Have you verified whether there are any database locks involved?

------------------
Marco Kalter
Allround Automations
 
If there are no locks, I cannot imagine what the problem might be. Can you use the OracleMonitor to verify that it is indeed a SQL statement that is hanging?

------------------
Marco Kalter
Allround Automations
 
Download it from our web site, "use" the OracleMonitor unit in your project, run the Monitor (the Monitor item from the Oracle menu in the Delphi/C++Builder IDE), run your application, and watch what happens.

doamon.gif


------------------
Marco Kalter
Allround Automations
 
Back
Top