BLOB field in Entity CMP EJB (DB = Oracle)

I use Borland App Server 4.5.1 .
I have table, which has BLOB column.
My first question is:
What datatype should corresponding field in Entity CMP EJB have?
I set it to byte [].
When I deal with BLOB data of small size, everything is OK.
But when the size of BLOB data is few larger,
when I insert new record
an Oracle error happens: a sort of
"TNS adapter error: end of communication chanel"
I use thin jdbc-driver.
So does anybody have an experience in working with BLOB field in Entity CMP EJB (DB = Oracle) ?
may be, the solution is to write BMP fields in Entity EJB,
i.e. to write own methods
set[BLOB_COLUMN](...),
get[BLOB_COLUMN]() ?
Thank you for answers.

I have tried with db2 7.1/ IAS 4.0 and it works fine
I use Borland App Server 4.5.1 .
I have table, which has BLOB column.
My first question is:
What datatype should corresponding field in Entity CMP
EJB have?
I set it to byte [].this is perfect
When I deal with BLOB data of small size, everything
is OK.
But when the size of BLOB data is few larger,
when I insert new record
an Oracle error happens: a sort of
"TNS adapter error: end of communication chanel"In db2 there is a max size limit on the blob column. please check if such limit for oracle database.
>
I use thin jdbc-driver.
So does anybody have an experience in working with
BLOB field in Entity CMP EJB (DB = Oracle) ?
may be, the solution is to write BMP fields in Entity
EJB,
i.e. to write own methods
set[BLOB_COLUMN](...),
get[BLOB_COLUMN]() ?this is a good approach
>
Thank you for answers.Regards,
-- Ashish

Similar Messages

  • Adding more fields to a CMP EJB

    I'm using Sun's ONE studio 5, Sun ONE AS, and PointBase-db.
    I use the CMP EJB wizard to generate the skeleton for a CMP EJB, and specify to use a database-table from PointBase as the CMP-persistant fields.
    The problem arises when i want to add futher fields, when i try adding the in the IDE, i cant deploy the application(!)
    What am i doing wrong?
    Thank you in advance!

    Please see response to
    http://forum.java.sun.com/thread.jsp?forum=136&thread=444274&start=0&range=15#2191688
    vbk

  • Paradox - Should entity CMP EJB be faster than stateless session bean?

    Please bear with me on this.
    Just thinking of this scenario: hello world application. It can be implemented both as stateless session bean and entity bean.
    There's no persistent. So for the entity bean, it will be container managed, and no code to do anything to the load/remove/create. - comparably the same as stateless bean.
    Next, for the stateless session bean, each client call would require a dedicated instance of the EJB on the server (although for a very short amount of time). For the entity bean, it's shared, so only 1 instance is needed. It's also thread safe.
    So, for a very high traffic, shouldn't the entity bean do better because of single instance?
    What's other overhead?
    Does the entity bean cost more connections than the stateless bean?

    Feels like a comparison between apples and oranges.
    A stateless session bean is like every other instance, so these can be pooled by the EJB container. The container is free to create an instance for each client if necessary. That's different.
    A stateless session bean doesn't have to deal with a database that may or may not be located on another machine the way an entity bean does. There could be another network round trip involved. That's different.
    Session and entity beans are intended for entirely different purposes. Just because you can write Hello World with both doesn't mean it's representative of what EJBs are used for. I don't think it's a good, meaninful comparison. JMO - MOD

  • BLOB & CMP EJB - Cannot bind stream to a ScrollableResultSet

    Hi,
    I am trying to bind a byte[] to a Blob column in CMP EJB using Oracle 10g OCI driver in WebSphere. This gives the below error.
    java.sql.SQLException: Cannot bind stream to a ScrollableResultSet or UpdatableResultSetDSRA0010E: SQL State = null, Error Code = 17,169
         at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapException(LocalExceptionMappingStrategy.java:195)
         at com.ibm.ejs.container.LocalExceptionMappingStrategy.setUncheckedException(LocalExceptionMappingStrategy.java:266)
         at com.ibm.ejs.container.EJSDeployedSupport.setUncheckedLocalException(EJSDeployedSupport.java:318)
    Thanks

    When you create a DataSource, use the below class in the field 'Data Source helper classs name'. This should solve the issue.
    import java.util.Properties;
    import javax.resource.ResourceException;
    import com.ibm.websphere.appprofile.accessintent.AccessIntent;
    public class OracleDataStoreHelper extends com.ibm.websphere.rsadapter.OracleDataStoreHelper {
         public OracleDataStoreHelper(Properties props) {
              super(props);
         public int getResultSetConcurrency(AccessIntent intent)     throws ResourceException {
              return java.sql.ResultSet.CONCUR_READ_ONLY;
    }

  • CMP EJBs for Weblogic 6.1

    Hi All
    It seems that when I use the functionality to build a CMP EJB (an EJB that is automatically built based on an Oracle table) the deployment descriptors are missing lots of info so it it not possible to deploy to Weblogic (6.1).
    I'm assuming the functionality intended is that it will be possible to automatically generate CMP EJBs from Oracle and deploy them directly to a iAS/Weblogic etc....
    Session Beans seem OK.
    Anyone got any thoughts on this?
    Dave

    For Weblogic - Users can develop session beans add weblogic-ejb-jar.xml and
    deploy to a WebLogic connection.
    If the project doesn't have a weblogic-ejb-jar.xml and a connection type of Weblogic is choosen for deployment , weblogic-ejb-jar.xml is automatically generated for the EJBs and wrapped in the EJB.jar before deploying to WLS.
    JDeveloper provides Deployment descriptor editors for editing weblogic-ejb-jar.xml thru UI panels. This is very convinient rather than hand editing the XML.
    Currently you would have to add Weblogic cmp specific deployment descriptor into the project and make it part of the EJB.jar during the assembly process (i.e when you create the deployment profile).
    raghu
    JDev Team

  • CMP EJB CLOB/BLOB retrieval issues from Oracle through JBoss

    I have some EJB 2.0 CMP Entity Beans, deployed on a JBoss 3.07 application server.
    In some of my beans I have Strings that I would like to map to a CLOB in my database as the Strings could easily be more than 4000 characters, and some byte arrays that I would like to map to a BLOB in my database to store files.
    When I use PostgreSQL as my datastore in JBoss I can store and retrieve data from my CLOBs and BLOBs just fine.
    However when I use an Oracle 9i (9.0.1) database for my datastore, I can write the information to the CLOB/BLOB fields (I can see it when I manually check the tables), but for some reason I cannot retrieve the information when I load my beans. The fields that map to the CLOB/BLOB are null, and eventually resave themselves overwriting the data in the database.
    When I test using LONG RAW as a type it works perfectly, but LONG RAW is not a standard SQL type. I do not want to convert my beans to BMP, and also do not want to have any Oracle specific code in my beans to store retrieve my information. I need my beans to be completely database independant.
    Does anyone have any ideas what could be causing my retrieval problem and what I could do to fix it?

    I solved my problem.
    I am using XDoclet to generate my bean interfaces and xml files etc., and it generates the jbosscmp-jdbc.xml file for me.
    I forgot to add @jboss tags to my beans so that the jbosscmp-jdbc.xml file includes tags to overwrite the default cmp mapping (string to varchar) to be from string to clob for those specific long string fields that i want.

  • Running CMP EJB in remote OC4J fails, works in embedded. Oracle 9i

    I more or less followed the EJB Tutorial (in the help) for creating a session-entity bean facade from Oracle 9i tables. Everything executes correctly in the embedded oc4j but it fails on the remote oc4j with
    java.sql.SQLException: Invalid column name
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:187)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:229)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:292)
         at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:5632)
         at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:716)
         at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1506)
         at com.evermind.sql.FilterResultSet.getString(FilterResultSet.java:585)
         at EmployeeLocalHome_EntityHomeWrapper13.findAll(EmployeeLocalHome_EntityHomeWrapper13.java:1260)
    Then I also created another simpler CMP EJB that just has 3 fields from Oracle table. This one doesn't even work in embedded oc4j :
    com.evermind.server.rmi.OrionRemoteException: Database error: ORA-01747: invalid user.table.column, table.column, or column specification
         java.util.Collection TimesheetHoursHome_EntityHomeWrapper11.findAll()
    Are there any known problems I should look out for with generating CMP EJBS with wizards?
    I think the IDE is more intuitive than WSAD. It would be great it things worked though.
    Another question is regarding relationships. Do the wizards always use ejb-refs to implement relationships? It should be easy enough to add them with EJB Editor if they do not.
    Thanks for any help.

    Known issues are documented in the release notes
    http://otn.oracle.com/products/jdev/htdocs/readme_903Preview.html#ejb
    <<<Another question is regarding relationships. Do the wizards always use ejb-refs to implement relationships? >>>>
    Not sure what you meant here. If you reverse engineer let us say DEPT and EMP tables, foreign key relationships between the tables are reverse engineered as CMR but there aren't any ejb-ref/ejb-local-ref tags which get generated in the deployment descriptor.
    <<It should be easy enough to add them with EJB Editor if they do not. >>
    You can double-click on the EJB to bring the EJB Module Editor and select "Relationships" node to add/edit/delete relationships visually.
    raghu
    JDev Team

  • How to upload size 4k file to oracle BLOB field

    hi all, i'm using Oracle 9i, Orcale JDBC thin Driver and ibm websphere to develop a java application.i have used java EJB/CMP to insert images into BLOB field in oracle.
    i used byte[] mapping to BLOB.i did it successfully.
    however, i'm facing another problem. it is that
    when i insert files larger than 4k, there is exception error. it said that the inserted value is too large.
    is that the problem of orcale JDBC?
    is that any solution to solve this restriction?
    it is very urgent, pls help!
    thx a lot

    Hi Lee
    Thanks for ur valuable suggestions. Please give me
    more idea i would really thank to u !Which part is giving you troubles?
    Oh - and change my suggestion to use setBinaryStream to a suggestion to use setAsciiStream, as I missed the part where you said "text file".
    >
    Can anybody tell me anyother way how to solv thid
    problem
    Depending on the size of the text file you could just read the file so you have the contents as a String and use setString (also in the PreparedStatement interface).
    hanks
    Message was edited by:
    MerlinRosina

  • Blob field using cmp

    Hi ,
    I need to retrieve the blob data stored in oracle 9i database.
    I am using studio 5 to create a CMP using which the blob field gets mapped to java.io.Serializable class. Oracle thin driver is used and an image of size 1 kb is stored in the table.
    When the client (servlet) calls the method to get the contents of the blob field, the following exceptions are thrown :
    com.sun.jdo.api.persistence.support.JDOFatalDataStoreException: IOException reading serializable object from byte array.
    NestedException: java.io.StreamCorruptedException: invalid stream header
         at com.sun.jdo.spi.persistence.support.ejb.cmp.JDOEJB11HelperImpl.readSerializableObjectFromByteArray(JDOEJB11HelperImpl.java:340)
         at orclblobfolder.orclejb.orclblobBean_1927863344_ConcreteImpl.getImage(orclblobBean_1927863344_ConcreteImpl.java:177)
         at orclblobfolder.orclejb.orclblobBean.getBlobImage(orclblobBean.java:84)
         at orclblobfolder.orclejb.orclblobBean_1927863344_ConcreteImpl_EJBObjectImpl.getBlobImage(orclblobBean_1927863344_ConcreteImpl_EJBObjectImpl.java:22)
         at orclblobfolder.orclejb._orclblobBean_1927863344_ConcreteImpl_EJBObjectImpl_Tie._invoke(Unknown Source)
         at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:569)
         at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:211)
         at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:113)
         at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:275)
         at com.sun.corba.ee.internal.iiop.LocalClientRequestImpl.invoke(LocalClientRequestImpl.java:96)
         at com.sun.corba.ee.internal.corba.ClientDelegate.invoke(ClientDelegate.java:237)
         at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOAClientSC.java:97)
         at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
         at orclblobfolder.orclejb._orclblob_Stub.getBlobImage(Unknown Source)
         at orclblobfolder.orclejb._orclblob_Stub.getBlobImage(Unknown Source)
         at test.processRequest(test.java:67)
         at test.doGet(test.java:127)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
         at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
         at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
         at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
         at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    snippet of bean class is :
    public abstract java.io.Serializable getImage();
    public abstract void setImage(java.io.Serializable image);
    public java.io.Serializable getBlobImage() {
    //method which client calls
    return getImage();
    Similar exceptions are thrown when I use poinbase wherein blob data is mapped to byte[] instead of java.io.Serializable.
    Please let me know how can I resolve this problem.
    Thanks a lot,
    -Amol

    How does it effect, when the blob data is stored indatabase using an external source
    The current CMP implementation assumes that a serializable field is stored by serializing it to a byte[] and then storing the byte[] as blob. while retrieving the data, it always tries to de-serialize the byte[] in to a serializable field. Hence if you have stored the data externally, it would fail with "JDOFatalDataStoreException: IOException reading serializable object from byte array."
    Thanks,
    Mitesh

  • Additional field in join table for CMP EJB

    Hello,
    I'm trying to perform this task using CMP entity beans:
    The entity A has a CMR relation of cardinality m-n with entity B (bidirectional) (This is working fine).
    I want to add a parameter to the relation.
    Ex : When I find that A1 is linked to B1, I need to perform "x" times an action. x would be my parameter, and I would have kept this parameter as an additional column in the join table A_TO_B.
    Could anyone provide an example of how to perform this with CMP EJB?
    NOTE: I'm using OC4J 10g 9.0.4 standalone (and cannot change my version).
    Thanks
    Tanguy

    Manohar,
    You need to create an append structure for table VBAP (for example ZAVBAP) using SE11. In this structure you create your ZZ fields. If you need a non-SAP domain/data element for your field then you need to create it first using the same transaction and activate it. Attach ZAVBAP to VBAP so the SE11 shows:
    .APPEND in the Fields column and
    ZAVBAP in the Field type column.
    Your ZZ fields will be shown automatically.
    When you have finished then activate your ZAVBAP structure. You will notice when you go VA01 (for example) that a lot of programs are being recompiled. Don't worry. It will be ok.
    The user-exit screen number for items is 8459 (in program SAPMV45A).
    Thanks,
    Wojtek

  • Weblogic and cmp with blob fields

    I have an entity bean with cmp. This bean has a blob field. When ejbCreate and
    ejbPostCreate methods are executed in this bean, exception saying "row containing
    the LOB value is not locked" is thrown.
    The transaction attribute for the method is set to RequiresNew in the deployment
    descriptor.
    Can someone suggest what may be going wrong here.
    Thanks

    I have an entity bean with cmp. This bean has a blob field. When ejbCreate and
    ejbPostCreate methods are executed in this bean, exception saying "row containing
    the LOB value is not locked" is thrown.
    The transaction attribute for the method is set to RequiresNew in the deployment
    descriptor.
    Can someone suggest what may be going wrong here.
    Thanks

  • Using a CMP Entity Bean local stub as a field of another CMP Entity Bean

    Hello,
    Is it possible to implement a field of a CMP Entity bean as another CMP Entity bean and how is it done?
    I've seen a pseudo code for this in Ed Roman's Mastering EJBs, second edition, but I can't seem to get it to work (pages: 330 - 1:1 using CMP and 339 - fake M:N using CMP).
    I'm using SUN ONE Application Sever 7. Is this server capable of this?
    I'm trying to implement a fake M:N relationship using 3 beans: 2 for each side of the relationship and one as the "bridge" table.
    For example, the two beans on each side of the relationship are SubscriberBean, SubscriptionBean and the "bridge: bean is SubscriberSubscriptionBean. The SubscriberSubscriptionBean has two fields: SubscriberLocal stub and SubscriptionLocal stub.
    Please let me know if you need more information to answer this question.
    Thanks.
    Nikola

    Im sorry but i dont know about the example you are talking about. I kinda learn
    all those techniques from forums, articles and tutorials because book often suffer from
    not having the information im mostly looking for.
    As far as i understand you, you want to implement a bridge been, which is representing a row in a join table. So that if one side of the relation is deleted the join-table entry (your bridge-CMP-Bean) is cascaded. Right?
    First of all the simple part: (My approach)
    - The joint table is foreign keys only - without a relation description. -
    In this case you dont have to implement a bridge bean. Because it just wouldnt represent anything of sense.
    Lets think of an entity/table USER whith the columns name (PRIMARY KEY), and prename.
    Our second entity/table is ADDRESS with the columns road (PRIMARY KEY) and housenr.
    The join table is simply: USER_ADDRESS with fk_name (FOREIGN KEY) and fk_road (FOREIGN KEY) both on CASCADE DELETE. So if the address is deleted the mapping entry is deleted, too same for the user part:
    USER -> USER_ADDRESS <- ADDRESS.
    Our entity Beans are called User and Address in class-names JNDI-names and names.
    Now we want to create the CMR mapping so we can access the addresses of a user from the user bean directly. The methods on the user side are:
    public abstract Collection getAddresses();
    and
    public abstract void setAddresses(Collection new_addresses);
    the xdoclet comments on the User side are (for the getter only)
    * @ejb.interface-method
    * @ejb.relation
    *                name = "User-has-Addresses"
    *                role-name = "User-Addresses"
    *                target-ejb = "Address"
    *                target-multiple = "true"
    * @sunone.relation
    *                column="USER_ADDRESS.fk_name"               
    *                target="USER_ADDRESS.fk_road"               
    public abstract Collection getAddresses();
    for the other side of the relation we define in the Address-Entity
    public abstract Collection getUsers();
    and
    public void setUsers(Collection users);
    the xdoclet comments on the Address side are (for the getter only)
    * @ejb.interface-method
    * @ejb.relation
    *                name = "User-has-Addresses"
    *                role-name = "Address-User"
    *                target-ejb = "User"
    *                target-multiple = "true"
    * @sunone.relation
    *                target="USER_ADDRESS.fk_road"               
    *                column="USER_ADDRESS.fk_name"
    As we dont want the user or address to be deleted if the other side of the relation is deleted we dont specify cascade-delete="yes" in the ejb.relation namespace.
    The sun-cmp-mappings.xml should now look like this:
    (For the User - side)
    <!-- Relationship User-has-Addresses, role User-Addresses -->
    <cmr-field-mapping>
    <cmr-field-name>addresses</cmr-field-name>
    <column-pair>
    <column-name>USER_ADDRESS.fk_name</column-name>
    <column-name>USER_ADDRESS.fk_road</column-name>
    </column-pair>
    </cmr-field-mapping>
    and similar on the Address-Side:
    <cmr-field-mapping>
    <cmr-field-name>users</cmr-field-name>
    <column-pair>
    <column-name>USER_ADDRESS.fk_road</column-name>
    <column-name>USER_ADDRESS.fk_name>/column-name>
    </column-pair>
    </cmr-field-mapping>
    Dont forget that all elements in the Collection must be of the right Interface-type.
    First of all the harder part:
    Now what you might want is when the relation has some information specified like user live at address and is tenant or facility manager.
    The, in the first step you will have to implement the UserAddressRelation entity which will have to CMR fields of the 1:N type.(Just as you wish)
    Lets think of the example above extended by the relation type. Our relation bean is named UserAddressRelation.
    Now User has the methods as above but the classes in the Collection must now be of the UserAddressRelationLocal/Remote interface and not AddressLocal/Remote-interface.
    You will have to change the xdoclet comment to:
    * @ejb.interface-method
    * @ejb.relation
    *                name = "User-has-Addresses"
    *                role-name = "User-Address"
    *                target-ejb = "UserAddressRelation"
    *                target-multiple = "true"
    * @sunone.relation
    *                target="USER_ADDRESS.fk_name"               
    *                column="USER.name"
    So we now dont reference the other side bean directly. We reference the relation EntityBean. Do the similar changes on the other side.
    In particular you will have to specify 4 CMR mappings now:
    1. User to UserAddressRelation 1:N
    2. UserAddressRelation N:1
    3. Address to UserAddressRelation 1:N
    4. UserAddressRelation N:1
    Which i dont want to explain in detail now because its kinda all the same as above.
    Now you cann access the Addresses of a user in the way.
    UserLocal.getAddresses(); <- !you get the mappings!
    UserLocal.getAddresses().item(0).getAddress() <- you get the address (this is dirty coding just for understanding)
    UserLocal.getAddresses().item(0).getUserRole() <. you get the role of the user at this address.
    Hope this helped you. You are welcome to ask any detailed question.

  • Error while trying to store PDF in Oracle's BLOB field

    Hi folks!
    I'm having problems while trying to store PDF file in a BLOB field of an Oracle table
    This is the message code:
    Exception in thread "main" java.sql.SQLException: Data size bigger than max size for this type: 169894
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:95)
    at oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2414)
    at oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1134)
    at oracle.jdbc.driver.OraclePreparedStatement.setBytes(OraclePreparedStatement.java:2170)
    at vgoactualizacion.Main.main(Main.java:84)     
    This is the piece of code i'm using:
    Assuming conn = conection to Oracle 10g Database ( it's working )
    String miProcedimientoAlmacenado = "{ call package_name.update_client(?,?, ?) }";
    CallableStatement miComando = conn.prepareCall(miProcedimientoAlmacenado);
    miComando.setString(1,miClienteID ); //first parameter : IN
                   //second parameter : IN
    File miPDF = new File(pathPDF + "//" + miClienteID + ".pdf");
    byte[] bodyIn = readFully(miPDF); //readFully procedure is shown below
    miComando.setBytes(2, bodyIn); //THIS IS THE LINE WHERE THE ERROR IS PRODUCED
              //3rd parameter: OUT
    miComando.registerOutParameter(3, java.sql.Types.VARCHAR);
    miComando.execute();
    private static byte[] readFully(File miPDF) throws FileNotFoundException, IOException {
    FileInputStream fis = new FileInputStream(miPDF);
    byte[] tmp = new byte[1024];
    byte[] data = null;
    int sz, len = 0;
    while ((sz = fis.read(tmp)) != -1) {
    if (data == null) {
    len = sz;
    data = tmp;
    } else {
    byte[] narr;
    int nlen;
    nlen = len + sz;
    narr = new byte[nlen];
    System.arraycopy(data, 0, narr, 0, len);
    System.arraycopy(tmp, 0, narr, len, sz);
    data = narr;
    len = nlen;
    if (len != data.length) {
    byte[] narr = new byte[len];
    System.arraycopy(data, 0, narr, 0, len);
    data = narr;
    return data;
    }//fin readFully
    This approach indicates that the PDF file is converted into an array of bytes, then is stored as binary in the BLOB field.
    Thanx in advance, and looking forward for your comments.

    You will probably need to use the setBinaryStream() method instead of setBytes().

  • Oracle error ORA-01461when trying to insert into an ORACLE BLOB field

    I am getting Oracle error ‘ORA-01461: can bind a LONG value only  for insert into a LONG column' when trying to insert into an ORACLE BLOB field. The error occurs when trying to insert a large BLOB (JPG), but does not occur when inserting a small (<1K) picture BLOB.(JPG). Any ideas?
    BTW, when using a SQL Server datasource using the same code.... everything works with no problems.
    ORACLE version is 11.2.0.1
    The ORACLE datasource is JDBC using Oracle's JDBC driver ojdbc6.jar v11.2.0.1 (I also have tried ojdbc5.jar v11.2.0.1; ojdbc5.jar v11.2.0.4; and ojdbc6.jar v11.2.0.4 with the same error result.)
    Here is my code:
    <cfset file_mime = Lcase(Right(postedXMLRoot.objname.XmlText, 3))>
    <cfif file_mime EQ 'jpg'><cfset file_mime = 'jpeg'></cfif>
    <cfset file_mime = 'data:image/' & file_mime & ';base64,'>
    <cfset image64 = ImageReadBase64("#file_mime##postedXMLRoot.objbase64.XmlText#")>
    <cfset ramfile = "ram://" & postedXMLRoot.objname.XmlText>
    <cfimage action="write" source="#image64#" destination="#ramfile#" overwrite="true">
    <cffile action="readbinary" file="#ramfile#" variable="image_bin">
    <cffile action="delete" file="#ramfile#">
    <cfquery name="InsertImage" datasource="#datasource#">
    INSERT INTO test_images
    image_blob
    SELECT
    <cfqueryparam value="#image_bin#" cfsqltype="CF_SQL_BLOB">
    FROM          dual
    </cfquery>

    Can't you use "alter index <shema.spatial_index_name> rebuild ONLINE" ? Thanks. I could switch to "rebuild ONLINE" and see if that helps. Are there any potential adverse effects going forward, e.g. significantly longer rebuild than not using the ONLINE keyword, etc? Also wondering if spatial index operations (index type = DOMAIN) obey all the typical things you'd expect with "regular" indexes, e.g. B-TREE, etc.

  • Problems accessing fields in a CMP entity bean from a session bean

    Hello everybody,
    I'm getting the next problem: when I try to access a field in a CMP entity bean that I have instantiated from a session bean (trhoug entitybean.getNameOfField), I get the error "the entity bean does not exist in the database".
    This entity bean is accessing a table in an external database (not the DB of the WAS), but I know that it's getting the correct data from the table, since  I check the entitybean.size() and the entitybean.findByPrimaryKey(), and I get the right information. For some reason, the only thing that it doesn't work in the entity bean are the getter/setter methods (I created them automatically after having created the entity fields).
    I access the entity bean through its local interface...
    I know it's really difficult to give an answer with so few details, but... does anybody think I forgot something important to configure??
    Thank very much in advance!!
    Isidro

    getter and setter methods for cmp-fields are abstract.
    getter and setter methods for cmr-fields are abstract.
    "John Lee" <[email protected]> wrote:
    >
    Hi:
    Which method in a CMP Entity bean should be abstract? just only SetXXX
    and
    GetXXX?
    Thanks!
    John Lee

Maybe you are looking for

  • Error while deleting the T-Code

    i am trying to delete the T-code thru se93 but it gives following error Choose a change request with target system TRQ can u help abhishek suppal

  • Using parallax scrolling on a browser fill shape?

    Hi everyone, Is it possible to apply parallax scrolling onto a shape that is extended to horizontally fill up the browser? I'm creating a single page scroll website and a want a shape to cover up a certain fraction of the bottom of the browser (I can

  • IPad and iTunes Match

    Whenever I turn on iTunes Match on my ipad it warns me that all music currently on my ipad will be replaced by songs and lists from iTunes Match...in the process I lose a lot off music, not to mention time put in....why does it do this?

  • Iweb and iwork's numbers program

    Can I import a fully functional table created in iwork 09 NUMBERS into a website I created in iweb? I can save my NUMBERS table as a pdf in order to put it in my website, but it's not functional that way. Need help.

  • No Photomerge after Snow Leopard install and several crashes!

    Installed Snow Leopard (PowerMac Intel dual core 2 x 2.66, 9 Gb RAM) and no noticeable increase in speed but now Photomerge to PS CS4 no longer works. I can output a merge of two images but three or more does not work. Also, lightroom has crashed abo