From user-return-621-apmail-geronimo-user-archive=geronimo.apache.org@geronimo.apache.org Fri Jul 29 14:36:17 2005 Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 16603 invoked from network); 29 Jul 2005 14:36:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Jul 2005 14:36:12 -0000 Received: (qmail 17441 invoked by uid 500); 29 Jul 2005 14:35:59 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 17408 invoked by uid 500); 29 Jul 2005 14:35:59 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 17394 invoked by uid 99); 29 Jul 2005 14:35:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2005 07:35:58 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [209.233.18.245] (HELO buttons.boynes.com) (209.233.18.245) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2005 07:35:51 -0700 Received: from [192.168.37.199] (unknown [192.168.37.199]) by buttons.boynes.com (Postfix) with ESMTP id 7260711372 for ; Fri, 29 Jul 2005 07:35:56 -0700 (PDT) Message-ID: <42EA3ECB.9030602@apache.org> Date: Fri, 29 Jul 2005 07:35:55 -0700 From: Jeremy Boynes User-Agent: Mozilla Thunderbird 1.0.6-1.1.fc3 (X11/20050720) X-Accept-Language: en-us, en MIME-Version: 1.0 To: user@geronimo.apache.org Subject: Re: access a BLOB coloumn from a CMP EJB References: <42E9CAC4.1080401@gmail.com> In-Reply-To: <42E9CAC4.1080401@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N It is probably simplest if we add byte[] as a mapped type inside TranQL as that will result in the bytes being written to the LOB rather than having it serialize an array object. I will try to add that mapping over the weekend. Having said that, the Serializable converter should work if you are inserting the LOB using the EJB (and not directly through JDBC). The stack you sent is from when we decided to roll the transaction back, there should be another stacktrace in the log showing the true root cause - can you post that one please. -- Jeremy Stefan Schmidt wrote: > Hi, > > I am trying to access a (MySQL) MEDIUMBLOB coloumn from a CMP EJB. There > are some tips @ Wiki but I still can't figure it out. > > Here are my artefacts: > > openejb-jar.xml: > > > image > image > BLOB > > org.tranql.sql.typeconverter.SerializableConverter > > > > > CMP EJB fields: > > public byte[] getImage(); > > public void setImage(byte[] image); > > > When trying to access this coloumn from my Session EJB : > > book.getImage(); > > I get: > > javax.transaction.TransactionRolledbackException: Unable to load data > for field > at > org.openejb.transaction.ContainerPolicy$TxRequired.invoke(ContainerPolicy.java:126) > > at > org.openejb.transaction.TransactionContextInterceptor.invoke(TransactionContextInterceptor.java:80) > > at > org.openejb.SystemExceptionInterceptor.invoke(SystemExceptionInterceptor.java:82) > > at org.openejb.GenericEJBContainer.invoke(GenericEJBContainer.java:234) > at > org.openejb.proxy.EJBMethodInterceptor.intercept(EJBMethodInterceptor.java:129) > > at > org.openejb.proxy.EntityEJBObject$$EnhancerByCGLIB$$227af363.getImage() > > at com.ibm.dw.bookshop.ejb.BookShopBean.getBooks(BookShopBean.java:135) > ... > > Do I have to write my own /Type**Converter to get it right? > > Could anyone provide a short example on this (preferably write it on the > wiki so everyone can see it)? > > The wiki link: > http://wiki.apache.org/geronimo/Working_with_Enterprise_JavaBeans > > Thanks, > > Stefan > /