Time flips to Midnight when record is duplicated

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

Time flips to Midnight when record is duplicated

Postby gdurniak » Tue Apr 16, 2013 1:00 pm

This is a very nasty bug in Servoy 6.1

We are using Sybase Anywhere 10 with TIME columns ( which appear as DateTime columns in Servoy )

When a user duplicates a record ( from the Smart Client menu ) with a Time ( e.g. 3:00 pm ) the duplicate record APPEARS OK, but in the background Sybase stores the Time as 12:00am

Servoy does not properly refresh the Form, so the user is unaware, and there are no errors in the Server Log

( it seems that Smart Client just repeats the cached record, rather than fetch the result of the INSERT )

When another user opens the record, it of course shows 12:00 am

There are no calculated or auto entered values

Please Help !

Debugging is difficult, since both the Server Log AND the Sybase query log hide the actual INSERT data values used

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Time flips to Midnight when record is duplicated

Postby rgansevles » Tue Apr 16, 2013 9:23 pm

Greg,

Servoy never refreshes inserted data in the db, data inserted should be the same as data stored.
Only for sequences generated by the db we requery.

I expect that we send the correct time to the driver, but to debug that you could try to use a logging-wrapper-driver like log4jdbc.

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: Time flips to Midnight when record is duplicated

Postby gdurniak » Tue Apr 16, 2013 10:54 pm

just curious, why do both the Servoy and Sybase Logs not show the actual data sent ?

is this for security reasons ?

it's a bit crazy that I have to install yet another driver just to see the conversation between these two applications !

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Time flips to Midnight when record is duplicated

Postby rgansevles » Wed Apr 17, 2013 9:01 am

Greg,

You can also turn on debug logging, see http://wiki.servoy.com/display/DOCS/Server+Log+Settings

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: Time flips to Midnight when record is duplicated

Postby gdurniak » Wed Apr 17, 2013 12:26 pm

Thanks, that worked, and is much easier. I set Debug=TRACE

The two INSERT time values are at the end:

INSERT INTO daypart:DBA:plan_records<db:/daypart/plan_records>#planrecords100(daypart:DBA:plan_records<db:/daypart/plan_records>#planrecords100.2179=plan_number<4,0,0>|daypart:DBA:plan_records<db:/daypart/plan_records>#planrecords100.2180=selected<4,0,0>
... |daypart:DBA:plan_records<db:/daypart/plan_records>#planrecords100.2194=time_from<92,0,0>|daypart:DBA:plan_records<db:/daypart/plan_records>#planrecords100.2195=time_to<92,0,0>

VALUES (${INSERT=[[10],[0],[NullValue with type: 4],[NullValue with type: 4],[NullValue with type: 1],[48 HOURS SAT 6P],[NullValue with type: 2],[Network],[30],[NullValue with type: 1],[GORDO Y LA FLACA],[Sat],[Sat],[6],[6],[10:00:00],[12:00:00]

which appears correct. Not sure why it fails. I even tried my own INSERT using 10:00:00, and it worked

But when using "duplicate record" in Servoy, it somehow sees 00:00:00 instead

greg

> You can also turn on debug logging, see http://wiki.servoy.com/display/DOCS/Server+Log+Settings
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Time flips to Midnight when record is duplicated

Postby gdurniak » Wed Apr 24, 2013 2:41 pm

I finally had to change all the DATE and TIME columns in Sybase to DATETIME

It seems that Servoy can do an UPDATE for edits, but not an INSERT for duplicates

I did find one note from Sybase that claimed a 4 byte DATE or TIME can not accept an INSERT of an 8 byte DATETIME ( e.g. from Servoy )

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 13 guests