Problem with Nullable fields?

Problem with Nullable fields?

Postby 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
ross_james
 
Posts: 8
Joined: Wed 15 Apr 2009 13:39

Postby 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?
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby 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.
ross_james
 
Posts: 8
Joined: Wed 15 Apr 2009 13:39

Postby 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.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Partially solve nullable property coming up empty

Postby 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
yosel
 
Posts: 7
Joined: Fri 20 Mar 2009 15:56

Postby 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
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

nullable fields

Postby 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
ross_james
 
Posts: 8
Joined: Wed 15 Apr 2009 13:39

Postby 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.
Shalex
Devart Team
 
Posts: 7293
Joined: Thu 14 Aug 2008 12:44

nullable fields

Postby 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!!!
yosel
 
Posts: 7
Joined: Fri 20 Mar 2009 15:56


Return to dotConnect for Oracle