You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "B.J. Reed (JIRA)" <ji...@apache.org> on 2009/02/24 21:31:01 UTC

[jira] Commented: (OPENJPA-922) setByteArrayInputStream being used in stead of setBytes

    [ https://issues.apache.org/jira/browse/OPENJPA-922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676403#action_12676403 ] 

B.J. Reed commented on OPENJPA-922:
-----------------------------------

Was premature with the patch.  The "fix" breaks BLOBs so it's no good.  Basically, both unserialized BLOBS and byte arrays go through the ByteArrayValueHandler in stead of the BlobValueHandler (determined in MappingHandler.defaultHandler()) so the jdbc layer doesn't know there is a difference between the 2 and can't make the correct call to set the data....the use of ByteArrayValueHandler for both also happened on Derby so we need a way to differentiate between the two different kinds of byte[] (BLOBs and char for bit data) so that we know which method to use to set the data in the DB.

> setByteArrayInputStream being used in stead of setBytes
> -------------------------------------------------------
>
>                 Key: OPENJPA-922
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-922
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 1.2.0, 2.0.0
>         Environment: DB2 on Windows
>            Reporter: B.J. Reed
>            Assignee: B.J. Reed
>             Fix For: 1.2.0, 2.0.0
>
>         Attachments: OPENJPA-922.patch
>
>
> I have an Entity and one of its fields is defined as CHAR(16) FOR BIT DATA NOT NULL.
> When trying to persist the entity, I get the following error:
>    Error: SQLCODE=-301, SQLSTATE=07006, SQLERRMC=1, DRIVER=3.50.152  
>    {prepstmnt 1386959531 INSERT INTO NULLID.TESTTBL (tkiid) VALUES (?)  
>    [params=(InputStream) java.io.ByteArrayInputStream@75947594]}
> It seems that the wrong kind of set is being used to set the parameter on the prepared statement.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.