Use CMP EJB inserting data to BLOB field of Oracle
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   max_seto
Posted On:   Monday, December 29, 2003 07:39 PM

Hi all, I am using IBM Websphere studio Application Developer. Has anybody passed an BLOB to an Oracle database via a CMP EJB? I am trying to do this but I appear to be having a little difficulty. First what Vap Converter should I use for the column in the Schema setup. I am using Oracle and I have setup a BLOB type column in my table. Is this the correct type? I have setup a CMP BLOB field in my Entity. oracle.sql.Blob photo; Setup the Simple Schema mapping, using: Column Logical Name: photo Column PhysicalName: photo Column Type: BLOB (2048)   More>>

Hi all,
I am using IBM Websphere studio Application Developer.



Has anybody passed an BLOB to an Oracle database via a CMP EJB?


I am trying to do this but I appear to be having a little difficulty.


First what Vap Converter should I use for the column in the Schema setup.


I am using Oracle and I have setup a BLOB type column in my table.


Is this the correct type?



I have setup a CMP BLOB field in my Entity.


oracle.sql.Blob photo;



Setup the Simple Schema mapping, using:



Column Logical Name: photo


Column PhysicalName: photo


Column Type: BLOB (2048)


Nulls Allowed: yes


Part of Primary key: no


Converter Class: VapBinaryStreamToSerializableObjectConverter



When I run the Entity in the Tesy Client it falls over with the following error:


com.ibm.ws.ejbpersistence.utilpm.PersistenceManagerException
com.ibm.ws.ejbpersistence.beanextensions.ConcreteBeanClassEx
tensionImpl.createPMException(Unknown Source)
at com.ibm.ws.ejbpersistence.beanextensions.PMModuleCookieImpl.getBindingName(Unknown Source)

at com.ibm.ws.ejbpersistence.beanextensions.PMModuleCookieImpl.beanInstall(Unknown Source)

at com.ibm.ws.ejbpersistence.beanextensions.PersistenceManagerImpl.beanInstall(Unknown Source)

at com.ibm.ejs.container.EJSContainer.loadBeanMetaData(EJSContainer.java:1331)

at com.ibm.ejs.container.EJSContainer.getHomeWrapperCommon(EJSContainer.java:976)

at com.ibm.ejs.container.EJSContainer.getHomeInstance(EJSContainer.java:899)

at com.ibm.ejs.container.EJSContainer.startBean(EJSContainer.java:878)

at com.ibm.ws.runtime.component.EJBContainerImpl.startBean(EJBContainerImpl.java:1255)

at com.ibm.ws.runtime.component.EJBContainerImpl.install(EJBContainerImpl.java:988)

at com.ibm.ws.runtime.component.EJBContainerImpl.start(EJBContainerImpl.java:1462)

at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:415)

at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:787)

at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:351)

at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:575)

at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:268)

at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:485)

at java.lang.reflect.Method.invoke(Native Method)
at com.tivoli.jmx.modelmbean.MMBInvoker.invoke
(MMBInvoker.java:46)

at com.tivoli.jmx.modelmbean.MMBInvoker.invokeOperation(MMBInvoker.java:115)

at com.tivoli.jmx.modelmbean.DynamicModelMBeanSupport.invoke(DynamicModelMBeanSupport.java:409)

at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:323)

at com.tivoli.jmx.GenericMBeanSupport.invoke(GenericMBeanSupport.java:178)

at com.tivoli.jmx.MBeanAccess.invoke(MBeanAccess.java:113)

at com.tivoli.jmx.MBeanServerImpl.invoke
(MBeanServerImpl.java:290)

at com.ibm.ws.management.AdminServiceImpl.invoke
(AdminServiceImpl.java:658)

at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:130)

at java.lang.reflect.Method.invoke(Native Method)

at com.ibm.ws.management.connector.soap.SOAPConnector.invoke(SOAPConnector.java:306)

at com.ibm.ws.management.connector.soap.SOAPConnector.service(SOAPConnector.java:178)

at com.ibm.ws.management.connector.soap.SOAPConnection.handleRequest(SOAPConnection.java:55)

at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)

at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:431)

at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))





Also in the AssemblyDescriptor
it warns me: photo must be a java primitive or a java serializable type (EJB 2.0:10.3.1)

   <<Less

Re: Use CMP EJB inserting data to BLOB field of Oracle

Posted By:   Bhagyashree_Jayaram  
Posted On:   Monday, January 19, 2004 01:14 AM

Hi,

I would like to know the type of the field photo in your entity bean.The entity bean field has to be one of the java types and on the database table you can map it to a BLOB.

If it is an objetc use

VapBinaryToObjectconverter.

Hope this helps... get back to me regarding your data type..

Bhagya
About | Sitemap | Contact