Timestamp concurrency issue

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
leeottaway
Posts: 30
Joined: Sat 10 Nov 2007 20:36

Timestamp concurrency issue

Post by leeottaway » Wed 28 Nov 2007 23:32

I have a strange problem. In my UTF8 encoded database I have several tables that have a "Created Date" TIMESTAMP field. In my IDE I set these fields to NOW. If I then save the created rows, and then try to edit or delete them in the IDE, and then save again I immediately get thrown a concurrency error. If I take the Created Date field out of the equation it all works fine so I know the problem specifically relates to that. All I know is, in my IDE if I look at the date field it says "29/11/2007 1:30:28 PM" whereas in the database it's stored as "29/11/2007 13:30:28". I'm amazed this would make a difference but I can't think of any other explanation.

Anyone have any ideas?

leeottaway
Posts: 30
Joined: Sat 10 Nov 2007 20:36

Post by leeottaway » Thu 29 Nov 2007 09:02

The other thing I've noticed is that when the Created Date gets saved to the database it is always shown as one second behind the one in the actual dataset! I have no explanation for this, however once again I don't know if that's causing the concurrency error, because if I manually change the Created Date in the database to increase the time by a second to match what's shown in the IDE it STILL throws a concurrency error on it.

I have no idea what's going on and this is driving me crazy since the exact same code works perfectly in databases other than pgSQL.

leeottaway
Posts: 30
Joined: Sat 10 Nov 2007 20:36

Post by leeottaway » Thu 29 Nov 2007 12:44

Phew! Finally resolved the issue. It was because of a bug in the way the CoreLabs provider seems to handle timestamps. Ordinarily it works fine, however I imported my database from Access and a number of fields came across as TimeStamp(0) type fields. After many many hours of struggling a colleague mentioned that his database simply had a TimeStamp field with no (0) and it worked fine. Sure enough changing the database field type to just TimeStamp worked perfectly.

Something I think for you guys at CoreLabs to keep an eye on.

SecureGen
Devart Team
Posts: 133
Joined: Thu 08 Sep 2005 06:27

Post by SecureGen » Thu 29 Nov 2007 14:15

Thank you for information. We will investigate the issue and change the behavior if necessary.

Post Reply