users@glassfish.java.net

How can I insert Blob data over 4000 byte with Toplink-Essential?

From: <glassfish_at_javadesktop.org>
Date: Fri, 01 Jun 2007 06:05:16 PDT

Hi.

I work with EJB3.0/Toplink-Essentials V2.0
And I would like to handle Blob Column that have data over 4000 byte.
But, I can get that, not set.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<snipped>
            Empimage aaa = em.find(Empimage.class, new Long(1));
            System.out.println(":" + aaa.getImage().length); -> OK 129310(Byte)
             
            Empimage bbb = new Empimage();
            bbb.setId(new Long(100)) ;
            bbb.setImage(aaa.getImage()) ;
            em.persist(bbb) ; --> NG

ternal Exception: java.sql.SQLException: ........ : 129310
Error Code: 17070

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I found that the type of @Lob of EJB3.0 JSR support Byte[], byte[], java.sql.Blob .
But I can't samples.

Thank you very much .
[Message sent by forum member 'wildrose' (wildrose)]

http://forums.java.net/jive/thread.jspa?messageID=219968