Page 1 of 1

Possible Oracle SQL script generation bug - missing sequences

Posted: Thu 11 Jul 2013 09:57
by willsteel
Hello,
I am using EntityDeveloper 5.5.120 and DotConnect for Oracle. My approach is to create a model first entity database. Here is my Problem:

> The auto-increment (seqneces and triggers in oracle) statements are only generated for the first table that is using identity primary key generation <

When i add another table by copy and pasting the first one with exact the same attributes, the SQL squence and trigger statements for the identity column are missing. I cant figure out why nor do I know a proper woraround. Unfortunately this leads to unresovable problems:

Code: Select all

ORA-01400: cannot insert NULL into ("WILL"."CLASS2"."PROPERTY2")
The following SQL code will be generated and used for two identical classes (names Class1 and Class2) that both only have one attribute that is the auto increment primary identity key. As you can see the second CREATE SEQUENCE is missing:

Code: Select all

-- 
-- Creating a table "will".CLASS2S 
-- 
CREATE TABLE "will".CLASS2S (
   PROPERTY2 NUMBER(10) NOT NULL,
   CONSTRAINT PK_CLASS2S PRIMARY KEY (PROPERTY2)
);

-- 
-- Creating a table "will".CLASS1S 
-- 
CREATE TABLE "will".CLASS1S (
   PROPERTY1 NUMBER(10) NOT NULL,
   CONSTRAINT PK_CLASS1S PRIMARY KEY (PROPERTY1)
);

-- 
-- Creating a sequence "will"."AI$CLASS1S_PROPERTY1_seq" 
-- 
CREATE SEQUENCE "will"."AI$CLASS1S_PROPERTY1_seq" START WITH 1 INCREMENT BY 1;

-- 
-- Creating a trigger "will".AI$CLASS1S 
-- 
CREATE OR REPLACE TRIGGER "will".AI$CLASS1S
   BEFORE INSERT ON "will".CLASS1S
   FOR EACH ROW
   BEGIN
      SELECT "will"."AI$CLASS1S_PROPERTY1_seq".NEXTVAL INTO :NEW.PROPERTY1 FROM DUAL;
   END;
Funny side notice: the sequence is beeing generated when deleting Class1 so it really sounds like a bug to me. I hope somebody can help me since I cant be the only one having this issue.

regards,
Will

Re: Possible Oracle SQL script generation bug - missing sequences

Posted: Fri 12 Jul 2013 08:23
by Shalex
Thank you for the report. The issue is fixed. We will post here when the corresponding build of dotConnect for Oracle is available for download.

Re: Possible Oracle SQL script generation bug - missing sequences

Posted: Fri 12 Jul 2013 13:03
by willsteel
Thx, I really hoped it was a misunderstanding or a configuration issue. I'll wait for the update then.

Re: Possible Oracle SQL script generation bug - missing sequences

Posted: Thu 18 Jul 2013 15:19
by Shalex
New version of dotConnect for Oracle 7.8 is released!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=1&t=27556.

Re: Possible Oracle SQL script generation bug - missing sequences

Posted: Wed 24 Jul 2013 16:49
by willsteel
Hey,

unfortunately, the bug is only partly fixed.
It works now when you have a CLEAN database and NOT use the "re-create" option.
However, when you have a database that should be wiped by the "re-create" option,
the bug is still there.

regards,
Michael

Re: Possible Oracle SQL script generation bug - missing sequences

Posted: Mon 29 Jul 2013 12:20
by Shalex
willsteel wrote:However, when you have a database that should be wiped by the "re-create" option,
the bug is still there.
We have reproduced the problem. We will notify you when it is fixed.

Re: Possible Oracle SQL script generation bug - missing sequences

Posted: Wed 31 Jul 2013 13:52
by Shalex
The bug with the "Recreate Database Tables" option for tables which use sequences is fixed. We will post here when the corresponding build of dotConnect for Oracle is available for download.

Re: Possible Oracle SQL script generation bug - missing sequences

Posted: Thu 08 Aug 2013 15:50
by Shalex
New build of dotConnect for Oracle 7.8.301 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=1&t=27701.