[ 
https://issues.apache.org/jira/browse/EMPIREDB-283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16744711#comment-16744711
 ] 

jan commented on EMPIREDB-283:
------------------------------

[~doebele]: I had / have the same (or a similar) problem with Postgres. 

As long as Empire-db writes the UPDATE_TIMESTAMP everything is ok. But after 
restoring a database from a dump (using the pg_dump tool) all timestamps have 
milliseconds and I cant update records anymore.

Postgres timestamp: 2018-10-03 21:39:05.491852
Empire-db timestamp: 2019-01-16 10:58:00

My workaround is to run UPDATE $TABLE SET update_timestamp = 
CAST(TO_CHAR(UPDATE_TIMESTAMP, 'yyyy-MM-dd HH:mm:ss') AS TIMESTAMP); for every 
table after a restore/import.

That won't help with the MSSQL problem, but I guess all databases that store 
milliseconds in timestamps are affected.

> PreparedStatements not working with MS SQL-Server > 2012
> --------------------------------------------------------
>
>                 Key: EMPIREDB-283
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-283
>             Project: Empire-DB
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: empire-db-2.4.4, empire-db-2.4.6, empire-db-2.4.7
>         Environment: JAVA 8, WIN2K12R2, MS-SQL-SRV > 2012, JDBC-Driver 4.2, 
> 6.0, 7.0
>            Reporter: Gunnar Kappei
>            Priority: Major
>
> Since the company I'm working at upgraded their database-servers from MS-SQL 
> 2012 to 2016, there seems to be an issue when using PreparedsStatements 
> together with Empire-DB.
> When enabling PreparedStatements via 
> DBDatabase#setPreparedStatementsEnabled(true), it's not possible to perfom 
> SQL-UPDATEs.
> Debugging the sources I found out, that the problem is located nside the 
> executeSql-method of the DBDatabase / DBDatabaseDriverMSSQL classes.  The 
> number of affected records is < 0. Therefore an exception is thrown. There is 
> no issue with INSERT statements.
> When disabling PreparedStatements, the code is working fine again since it 
> did for years now. Tried Empire-DB 2.4.4, 2.4.6, 2.4.7 and several versions 
> of the official JDBC driver from MS. On several database-servers. Getting the 
> same result every time. 
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to