Problem with Nullable fields?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
ross_james
Posts: 8
Joined: Wed 15 Apr 2009 13:39

Problem with Nullable fields?

Post by ross_james » Wed 15 Apr 2009 13:51

Hi,

I am having real trouble getting even a simple table to behave here, I feel I'm missing something fairly fundamental!

I have created a single table within Oracle with which I am testing the Linq capabilities of dotConnect for Oracle. The table has an autoincrement column (via sequence and trigger), 2 non-null fields and 2 nullable fields. I am able to retrieve a row using:

Code: Select all

Dim odb As New OracleData.OracleDataContext
Dim jn As OracleData.JOB_NODE = odb.JOB_NODEs.First(Function(j) j.NODEID = 1)
but no matter what is in the table, the nullable fields always come back as Nothing, and likewise if I try to give one a value using the below, the first line has no effect and the field is still Nothing, even after SubmitChanges:

Code: Select all

jn.PERSONID = 3
odb.SubmitChanges()
Also, for non-null fields, it does allow me to change the value but then throws a Concurrency exception when I run SubmitChanges().

I also get Concurrency exceptions when I try to Delete a row.

Inserting new rows works without error but for some reason inserts 2 rows every time, and Nullable fields do not get the value that I give them in code.

This has had me stumped for some time now, I'm sure it must be something obvious that I'm just missing.

Ross

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 16 Apr 2009 09:00

I can't reproduce the problem you described using the current 5.20.27 Beta version of dotConnect for Oracle.
Could you please specify the version of dotConnect for Oracle you are using?

ross_james
Posts: 8
Joined: Wed 15 Apr 2009 13:39

Post by ross_james » Thu 16 Apr 2009 09:39

Hi, I'm using version 5.0.26.0.

I used the tutorial method of "Create from Database..." in Entity Developer to create the classes.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 16 Apr 2009 13:26

Could you please send me the script of the DB objects you are using and the code generated by Entity Developer?
I'm still unable to reproduce neither the problem with First() method, nor the one with DBConcurrency violation.

yosel
Posts: 7
Joined: Fri 20 Mar 2009 15:56

Partially solve nullable property coming up empty

Post by yosel » Thu 23 Apr 2009 15:23

Hi,

I am having the same problem

for the first problem (nullable values coming up empty...) if you go to the data context class generated by dotconnect...and replace

If ((Me._yourNullableProperty = value) = false) Then

by...

If ((Me._yourNullableProperty.equals(value)) = false) Then

It will work...but this is painfull because every time you generate the class this change has to be done for all nullable properties...

Thanks

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 24 Apr 2009 09:42

This problem is fixed in the current 5.20.27 version.
It was also discussed here:
http://www.devart.com/forums/viewtopic.php?p=42958

ross_james
Posts: 8
Joined: Wed 15 Apr 2009 13:39

nullable fields

Post by ross_james » Mon 27 Apr 2009 16:23

Hi guys, thanks for the replies...

I came to the same conclusion as yosel a few days ago, but I also found that using the C# code generation rather than VB eliminates the problem, it just means our data layer needs to be in a separate C# project and then referenced.

Unfortunately we can't use the beta version as that fails at the first hurdle! When you go to "Create from Database..." in ED, it throws an error and nothing appears on the connection dialog.

I now have a new issue but is unrelated to this so I'll start a new thread.

Ross

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

Post by Shalex » Thu 30 Apr 2009 11:20

Please try using the new version (5.20.29) of dotConnect for Oracle.
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=14740 .

Please notify us if the problem is fixed.

yosel
Posts: 7
Joined: Fri 20 Mar 2009 15:56

nullable fields

Post by yosel » Tue 12 May 2009 14:09

Yes, In version 5.20 the issue with nullable values has been resolved...

thanks for your great support!!!

Post Reply