You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/06/18 00:07:03 UTC

[jira] [Commented] (ISIS-812) Isis 1.5 blob mapping broken for PostgreSQL (when set to null)

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

ASF subversion and git services commented on ISIS-812:
------------------------------------------------------

Commit 016bd824e27ec56f99a341a95e363ab556ee2fe7 in isis's branch refs/heads/master from [~danhaywood]
[ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=016bd82 ]

ISIS-812: fix for PostgreSQL blob handling (for null blobs)


> Isis 1.5 blob mapping broken for PostgreSQL (when set to null)
> --------------------------------------------------------------
>
>                 Key: ISIS-812
>                 URL: https://issues.apache.org/jira/browse/ISIS-812
>             Project: Isis
>          Issue Type: Bug
>          Components: Archetype: ToDoApp WRJ, Objectstore: JDO
>    Affects Versions: archetype-quickstart-wrj-1.5.0, objectstore-jdo-1.5.0
>            Reporter: Dan Haywood
>            Assignee: Dan Haywood
>            Priority: Minor
>             Fix For: archetype-quickstart_wrj-1.6.0, objectstore-jdo-1.6.0
>
>
> As reported on mailing list: http://markmail.org/thread/zoiu2v4sklo7mevq
> ~~~
> Looking into this, I've learnt that PostgreSQL does not support BLOB datatype, but instead supports "bytea" (byte array) and "oid".  The first is in-row storage, where the data is always returned in the result set, the second is a pointer to off-row storage; PostgreSQL provides its own API for handling oid types).
> For the Isis Blob class (org.apache.isis.applib.value.Blob) we provide our own IsisBlobMapping; this is automatically registered through metadata held in the JDO applib jar.   It is the job of this mapping class to read/set values on the underlying ResultSet / PreparedStatement.  DataNucleus provides some additional wrapping infrastructure.
> The warning mentioned in the mailing list post indicates that DN is treating the BLOB datatype as a "bytea".  This *almost* works fine; our IsisBlobMapping can persist non-null values ok, but attempting to set a null value breaks PostgreSQL; it treats the null as a null pointer of type "oid" (offline storage), rather than a null of type "bytea".
> After some experimentation, I've found a different way to set null that works for PostgreSQL and also works fine for HSQLDB, and MS SQL Server.
> This ticket is to apply that change.



--
This message was sent by Atlassian JIRA
(v6.2#6252)