Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Timestamp error #26

Open
rsasai opened this issue May 30, 2015 · 3 comments
Open

Timestamp error #26

rsasai opened this issue May 30, 2015 · 3 comments

Comments

@rsasai
Copy link

rsasai commented May 30, 2015

Hi

It was all good with the combination of:

  • vert.x 2.0.2-final
  • jdbc-persister 2.1.2

I have updated vert.x:

  • vert.x 2.1.5
  • jdbc-persister 2.1.2

Then I am getting this error:
[com.bloidoniamod-jdbc-persistor2.1.2-com.bloidonia.vertx.mods.JdbcProcessor-1715900756] Caught error with SELECT
org.vertx.java.core.VertxException: Cannot have objects of class class java.sql.Timestamp in JSON
at org.vertx.java.core.json.JsonElement.convertMap(JsonElement.java:60)
at org.vertx.java.core.json.JsonObject.(JsonObject.java:56)
at org.vertx.java.core.json.JsonObject.(JsonObject.java:45)
at com.bloidonia.vertx.mods.JsonUtils.listOfMapsToJsonArray(JsonUtils.java:61)
at com.bloidonia.vertx.mods.JdbcProcessor$4.process(JdbcProcessor.java:277)
...

To be honest this is frustrating because the only thing I did was upgrading vert.x.
Would it be possible for your persister to handle this so clients don't have to change their code, please?

Thank you.
Uppsax

@timyates
Copy link
Owner

Handle what?

Handle Vert.x changing what objects are natively allowed to be serialised
over the event bus?

I'll have a look to see if there's an easy solution to this, but can't
think of one off the top of my head at the moment

As a workaround, you could change your SQL so it returns a strong
representation of a timestamp rather than a timestamp itself
On 30 May 2015 10:20, "Ryu Sasai" [email protected] wrote:

Hi

It was all good with the combination of:

  • vert.x 2.0.2-final
  • jdbc-persister 2.1.2

I have updated vert.x:

  • vert.x 2.1.5
  • jdbc-persister 2.1.2

Then I am getting this error:
[com.bloidoniamod-jdbc-persistor2.1.2-com.bloidonia.vertx.mods.JdbcProcessor-1715900756]
Caught error with SELECT
org.vertx.java.core.VertxException: Cannot have objects of class class
java.sql.Timestamp in JSON
at org.vertx.java.core.json.JsonElement.convertMap(JsonElement.java:60)
at org.vertx.java.core.json.JsonObject.(JsonObject.java:56)
at org.vertx.java.core.json.JsonObject.(JsonObject.java:45)
at
com.bloidonia.vertx.mods.JsonUtils.listOfMapsToJsonArray(JsonUtils.java:61)
at com.bloidonia.vertx.mods.JdbcProcessor$4.process(JdbcProcessor.java:277)
...

To be honest this is frustrating because the only thing I did was
upgrading vert.x.
Would it be possible for your persister to handle this so clients don't
have to change their code, please?

Thank you.
Uppsax


Reply to this email directly or view it on GitHub
#26.

@rsasai
Copy link
Author

rsasai commented May 30, 2015

Thank you for your quick reply.
It's good that there's a workaround.
However, it seems that quite a few people have written a lot of sql already and are having the timestamp issue just because they have upgraded vert.x.
Now that vert.x has already moved on, which is a bit of a hindrance for the persister client, it would be a great piece of news for persister users if you could absorb the issue within the persister.
Thank you.
Uppsax

@timyates
Copy link
Owner

Not sure I can though.

I can change it to a string in the persister, but people would need to know
this, and parse it back out of a string on the client

With v3, this can probably be done with the new proxy methods, but these
don't exist in v2
On 30 May 2015 11:19, "Ryu Sasai" [email protected] wrote:

Thank you for your quick reply.
It's good that there's a workaround.
However, it seems that quite a few people have written a lot of sql
already and are having the timestamp issue just because they have upgraded
vert.x.
Now that vert.x has already moved on, which is a bit of a hindrance for
the persister client, it would be a great piece of news for persister users
if you could absorb the issue within the persister.
Thank you.
Uppsax


Reply to this email directly or view it on GitHub
#26 (comment)
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants