Possible Oracle SQL script generation bug - missing sequences

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
willsteel
Posts: 4
Joined: Thu 11 Jul 2013 09:46

Possible Oracle SQL script generation bug - missing sequences

Post by willsteel » Thu 11 Jul 2013 09:57

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

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Possible Oracle SQL script generation bug - missing sequences

Post by Shalex » Fri 12 Jul 2013 08:23

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.

willsteel
Posts: 4
Joined: Thu 11 Jul 2013 09:46

Re: Possible Oracle SQL script generation bug - missing sequences

Post by willsteel » Fri 12 Jul 2013 13:03

Thx, I really hoped it was a misunderstanding or a configuration issue. I'll wait for the update then.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Possible Oracle SQL script generation bug - missing sequences

Post by Shalex » Thu 18 Jul 2013 15:19

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.

willsteel
Posts: 4
Joined: Thu 11 Jul 2013 09:46

Re: Possible Oracle SQL script generation bug - missing sequences

Post by willsteel » Wed 24 Jul 2013 16:49

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

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Possible Oracle SQL script generation bug - missing sequences

Post by Shalex » Mon 29 Jul 2013 12:20

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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Possible Oracle SQL script generation bug - missing sequences

Post by Shalex » Wed 31 Jul 2013 13:52

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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Possible Oracle SQL script generation bug - missing sequences

Post by Shalex » Thu 08 Aug 2013 15:50

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.

Post Reply