Maybe little bug in LinQ2SQL Support

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
Zero-G.
Posts: 398
Joined: Sat 09 Dec 2006 12:20

Maybe little bug in LinQ2SQL Support

Post by Zero-G. » Mon 22 Jun 2009 12:35

Hey

I have the latest avaiable version of dotConnect for mySQL v5.20.33

I have two tables in my database, which are related by a FK
In the Entity Developer, they are also related.
Both tables have an Timestamp field (Default Value=Current_timestamp)
When I try to add a dataentry by code like:

Code: Select all

Dim tbl1 As New Table1 With{.Field = value}
Dim tbl2 As New Table2 With{.Field = value, _
                                           .Table1 = tbl1}

Then, I get an error (by submitting the changes to the Database), that in tbl1 is an invalid date-time , because I have not set it explicit.

The second thing would be a little feature for the next entity developer:
When there is a field as Timestamp with default value Current timestamp, then it should be isVersion = true.
This is not now, and I have to change this behaivor on to 100 tables....

THX

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

Post by AndreyR » Tue 23 Jun 2009 13:07

Thank you for the report, we will investigate the situation.

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

Post by AndreyR » Tue 23 Jun 2009 14:01

This behaviour will not be added, because default current timestamp value is not enough to consider the column a version.
In addition, there should be an update trigger to justify the setting of IsVersion attribute to true.
We don't have technical opportunity to check whether this trigger is present and does the necessary work,
so this responsibilty is delegated to users.

Zero-G.
Posts: 398
Joined: Sat 09 Dec 2006 12:20

Post by Zero-G. » Wed 24 Jun 2009 12:22

there should be an update trigger to justify the setting of IsVersion attribute to true
Is there more information about this? - I don't know yet, what you mean.

THX

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

Post by AndreyR » Wed 24 Jun 2009 14:43

When you insert the values, the value in the version column becomes current_timestamp().
When you update the values, the value in the version column is not changed.
So you need an update trigger to change the value of the version column.
As we can not check whether such trigger exists, we can't set IsVersion to true for the described column.

Zero-G.
Posts: 398
Joined: Sat 09 Dec 2006 12:20

Post by Zero-G. » Thu 25 Jun 2009 10:45

OK.
So, am I right, when I say the following:
I have to make an update Trigger (on the server) - This trigger changes the TimeStamp Column to the current date.
When I did this, then I can set the isVersion at the entity developer to true. - So that it would work.

???????????????????????????????????????????????????????????????????????

THX

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

Post by AndreyR » Fri 26 Jun 2009 13:43

Yes, you have described the correct way to use the Version columns.

Post Reply