1 Reply Latest reply on Aug 17, 2004 2:29 PM by artursaporito

    JBOSS + org.postgresql.largeobject.LargeObject API for BLOB

    pagomen

      Hi all,

      I am using JBOSS3.2.3 & Postgresql 7.4 and I am facing a problem wirting blobs ...

      Using the postgres jdbc driver there are 2 ways for writing/reading blobs
      1) using in the database a column type 'bytea' to store the binary file
      2) using in the database a column type 'oid' to store the binary file and the
      org.postgresql.largeobject.LargeObject API from the psql jdbc driver

      In the standardjbosscmp-jdbc.xml exists only the mapping for the first solution :

      <mapping>
      <java-type>java.lang.Object</java-type>
      <jdbc-type>VARBINARY</jdbc-type>
       <sql-type>BYTEA</sql-type>
      </mapping>
      


      Using this solution I get an OutOfMemory Exception form my Container Managed Bean when I am tying to write a binary file larger than 1 Mbyte.
      In order to make some tests I developed a standalone java-client to access the DB using the jdbc driver.
      Also the same exception occurs in this scenario.

      But using the second configuration in the database and the org.postgresql.largeobject.LargeObject API form the jdbc I was able to read/write blobs form the database using the standalone java client !

      Does anyone has any idea how we can configure JBOSS to access the DB using this API ???

      Thanks in advance
      George