You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Tony Giaccone <tg...@gmail.com> on 2016/07/11 22:56:41 UTC
Conversion error:
I'm using the H2 database and have a field that's a timestamp,
I get this message on trying to read the field with Cayenne:
org.h2.jdbc.JdbcSQLException: Hexadecimal string with odd number of
characters: "2016-07-11 18:21:16.0" [90003-192]
stack trace looks like:
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.util.StringUtils.convertHexToBytes(StringUtils.java:970)
at org.h2.value.Value.convertTo(Value.java:973)
at org.h2.value.Value.getBytes(Value.java:422)
at org.h2.jdbc.JdbcResultSet.getBytes(JdbcResultSet.java:1059)
at
org.apache.cayenne.access.types.ByteArrayType.materializeObject(ByteArrayType.java:86)
And it’s true the string is odd in length.
Seems odd…any thoughts?
Tony Giaccone
Re: Conversion error:
Posted by Andrus Adamchik <an...@objectstyle.org>.
A timestamp value should not be read via 'org.apache.cayenne.access.types.ByteArrayType'. Is it actually a timestamp on the Java end?
Andrus
> On Jul 12, 2016, at 1:56 AM, Tony Giaccone <tg...@gmail.com> wrote:
>
> I'm using the H2 database and have a field that's a timestamp,
>
>
> I get this message on trying to read the field with Cayenne:
>
>
> org.h2.jdbc.JdbcSQLException: Hexadecimal string with odd number of
> characters: "2016-07-11 18:21:16.0" [90003-192]
>
> stack trace looks like:
>
> at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
> at org.h2.message.DbException.get(DbException.java:179)
> at org.h2.message.DbException.get(DbException.java:155)
> at org.h2.util.StringUtils.convertHexToBytes(StringUtils.java:970)
> at org.h2.value.Value.convertTo(Value.java:973)
> at org.h2.value.Value.getBytes(Value.java:422)
> at org.h2.jdbc.JdbcResultSet.getBytes(JdbcResultSet.java:1059)
> at
> org.apache.cayenne.access.types.ByteArrayType.materializeObject(ByteArrayType.java:86)
>
> And it’s true the string is odd in length.
>
>
> Seems odd…any thoughts?
>
>
>
> Tony Giaccone
Re: Conversion error:
Posted by Gmail <tg...@gmail.com>.
Haven't tried that
Tony Giaccone
> On Jul 11, 2016, at 6:58 PM, Mike Kienenberger <mk...@gmail.com> wrote:
>
> Do you get the same error using non-cayenne java code while reading the field?
>
>> On Mon, Jul 11, 2016 at 6:56 PM, Tony Giaccone <tg...@gmail.com> wrote:
>> I'm using the H2 database and have a field that's a timestamp,
>>
>>
>> I get this message on trying to read the field with Cayenne:
>>
>>
>> org.h2.jdbc.JdbcSQLException: Hexadecimal string with odd number of
>> characters: "2016-07-11 18:21:16.0" [90003-192]
>>
>> stack trace looks like:
>>
>> at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
>> at org.h2.message.DbException.get(DbException.java:179)
>> at org.h2.message.DbException.get(DbException.java:155)
>> at org.h2.util.StringUtils.convertHexToBytes(StringUtils.java:970)
>> at org.h2.value.Value.convertTo(Value.java:973)
>> at org.h2.value.Value.getBytes(Value.java:422)
>> at org.h2.jdbc.JdbcResultSet.getBytes(JdbcResultSet.java:1059)
>> at
>> org.apache.cayenne.access.types.ByteArrayType.materializeObject(ByteArrayType.java:86)
>>
>> And it’s true the string is odd in length.
>>
>>
>> Seems odd…any thoughts?
>>
>>
>>
>> Tony Giaccone
Re: Conversion error:
Posted by Mike Kienenberger <mk...@gmail.com>.
Do you get the same error using non-cayenne java code while reading the field?
On Mon, Jul 11, 2016 at 6:56 PM, Tony Giaccone <tg...@gmail.com> wrote:
> I'm using the H2 database and have a field that's a timestamp,
>
>
> I get this message on trying to read the field with Cayenne:
>
>
> org.h2.jdbc.JdbcSQLException: Hexadecimal string with odd number of
> characters: "2016-07-11 18:21:16.0" [90003-192]
>
> stack trace looks like:
>
> at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
> at org.h2.message.DbException.get(DbException.java:179)
> at org.h2.message.DbException.get(DbException.java:155)
> at org.h2.util.StringUtils.convertHexToBytes(StringUtils.java:970)
> at org.h2.value.Value.convertTo(Value.java:973)
> at org.h2.value.Value.getBytes(Value.java:422)
> at org.h2.jdbc.JdbcResultSet.getBytes(JdbcResultSet.java:1059)
> at
> org.apache.cayenne.access.types.ByteArrayType.materializeObject(ByteArrayType.java:86)
>
> And it’s true the string is odd in length.
>
>
> Seems odd…any thoughts?
>
>
>
> Tony Giaccone