Autoincremental fields problem

Autoincremental fields problem

Postby Gianluca » Sat 30 Apr 2011 09:55

I'm testing dotConnect 6.30 for Oracle with VS2010 and Oracle XE 10g (at the moment) on a Silverlight project.
First of all I have found a big problem with the autoincremental field.
I have generated the Entity Data Model with MS wizard and using dotConnect provider.
The Identity fields are not configured so my app, that works perfectly with (MsSQLServer), fails.
I'have changed manualy the property field StoreGeneratedPattern to Identity and ricompiled everything but doesn't change!

Does you provider works with auto incremental field (implemented with SEQUENCE and TRIGGER in Oracle)?
If yes as I wrote on infos what is the best way to use it?


thank you very much
Gianluca
 
Posts: 13
Joined: Wed 28 Apr 2010 08:31

Postby Shalex » Tue 03 May 2011 11:55

Please open your model with XML Editor and make sure that the StoreGeneratedPattern attribute is set to Identity in the SSDL part of the model for the Entity Key property: http://www.devart.com/forums/viewtopic.php?t=18620.

We recommend you using Entity Developer. It allows editing storage part in designer.
Shalex
Devart Team
 
Posts: 7369
Joined: Thu 14 Aug 2008 12:44

Entity Developer and Auto-increment

Postby Gianluca » Wed 04 May 2011 08:17

thank you for answer,
I saw thar the field property was set to Identity but into the xml it was not.
I will try again to change and recompile.

in order to evaluate your product I have some more questions:
1.May I use Entity Developer to create the EDM, instead the MsWizard?
this is because my database still exist! so the model have to reflect it, ... why entity field are not default detected?

2. My "Entity Developer" seems disabled, I thought because the "Database Explorer" was empty. But I can not add new database or new connection! Update menu voices are disabled. Any reasons for that?
Gianluca
 
Posts: 13
Joined: Wed 28 Apr 2010 08:31

Autoincr fail

Postby Gianluca » Wed 04 May 2011 08:44

I have made the change you told me:





















but when I execute this command from the client page, the "Add method" has threw the exception that the ID still exist and fail

SESSION s = new SESSION();
ctx.SESSIONs.Add(s);

Mechanism "trigger+sequence" works because I tested it with sqldeveloper IDE

thank you
Gianluca
 
Posts: 13
Joined: Wed 28 Apr 2010 08:31

Postby Shalex » Thu 05 May 2011 14:16

1.
Gianluca wrote:1.May I use Entity Developer to create the EDM, instead the MsWizard?
this is because my database still exist! so the model have to reflect it, ... why entity field are not default detected?

We recommend using Devart Entity Developer for creating and managing EF models because Entity Developer is faster and more flexible.
Microsoft Entity Data Model Wizard is not adjusted for Oracle: http://www.devart.com/dotconnect/oracle ... izard.html .
Running Entity Developer: right click on your project > Add > New Item > the Data tab, the Devart Entity Model item.

2.
Gianluca wrote:2. My "Entity Developer" seems disabled, I thought because the "Database Explorer" was empty. But I can not add new database or new connection! Update menu voices are disabled. Any reasons for that?

Please run Tools > Entity Developer > Database Explorer (it opens the "Database Explorer - Entity Developer" window) and drag and drop the database objects on your model design surface.

3.
Gianluca wrote:but when I execute this command from the client page, the "Add method" has threw the exception that the ID still exist and fail

a) please make sure that your table does not already contain the value that is generated by trigger for this particular insert.
b) we have sent you a test project with the DDL script where StoreGeneratedPattern="Identity" works as expected. If you didn't receive it, check your spam filter.
Shalex
Devart Team
 
Posts: 7369
Joined: Thu 14 Aug 2008 12:44

Entity Developer

Postby Gianluca » Mon 09 May 2011 07:39

I would like to use the Entity Developer for Oracle in order to test it, but from your web site it is possible to download only ED Trial for SQLServer!
Gianluca
 
Posts: 13
Joined: Wed 28 Apr 2010 08:31

Postby Shalex » Tue 10 May 2011 09:37

Entity Developer for Oracle is included to the Professional and Developer editions of dotConnect for Oracle. Please refer to http://www.devart.com/dotconnect/oracle/editions.html.
We have received your e-mail. We will send you our response as soon as possible.
Shalex
Devart Team
 
Posts: 7369
Joined: Thu 14 Aug 2008 12:44

Works

Postby Gianluca » Wed 11 May 2011 07:56

I write in order to update my results.
Every things seem works properly. My problem was due to the ID=0: I mean, when a new record is added to the recordset the assigned id is 0, but in my table there was still a zero id record and so there was an exception.

Thank you for your help.
Gianluca
 
Posts: 13
Joined: Wed 28 Apr 2010 08:31


Return to dotConnect for Oracle