Deadlock in Oracle.sql.ARRAY type

Hi,
We've come across the deadlock situation below when running multiple J2EE MDB instances that are trying to write to the DB:
[deadlocked thread] [ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)':
Thread '[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'' is waiting to acquire lock 'oracle.jdbc.driver.T4CConnection@90106ee' that is held by thread '[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)''
Stack trace:
oracle.sql.ARRAY.toBytes(ARRAY.java:673)
oracle.jdbc.driver.OraclePreparedStatement.setArrayCritical(OraclePreparedStatement.java:5985)
oracle.jdbc.driver.OraclePreparedStatement.setARRAYInternal(OraclePreparedStatement.java:5944)
oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:8782)
oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8278)
oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:8868)
oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:240)
weblogic.jdbc.wrapper.PreparedStatement.setObject(PreparedStatement.java:287)
org.springframework.jdbc.core.StatementCreatorUtils.setValue(StatementCreatorUtils.java:356)
org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(StatementCreatorUtils.java:216)
org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(StatementCreatorUtils.java:127)
org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.setValues(PreparedStatementCreatorFactory.java:298)
org.springframework.jdbc.object.BatchSqlUpdate$1.setValues(BatchSqlUpdate.java:192)
org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:892)
org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:1)
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:614)
org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:883)
org.springframework.jdbc.object.BatchSqlUpdate.flush(BatchSqlUpdate.java:184)
com.csfb.fao.rds.rfi.common.dao.storedprocs.SaveEarlyExceptionBatchStoredProc.execute(SaveEarlyExceptionBatchStoredProc.java:93)
com.csfb.fao.rds.rfi.common.dao.EarlyExceptionDAOImpl.saveEarlyExceptionBatch(EarlyExceptionDAOImpl.java:34)
com.csfb.fao.rds.rfi.application.rulesengine.RulesEngine.saveEarlyExceptions(RulesEngine.java:302)
com.csfb.fao.rds.rfi.application.rulesengine.RulesEngine.executeRules(RulesEngine.java:209)
com.csfb.fao.rds.rfi.application.rulesengine.RulesEngine.onMessage(RulesEngine.java:97)
com.csfb.fao.rds.feeds.process.BaseWorkerMDB.onMessage(BaseWorkerMDB.java:518)
weblogic.ejb.container.internal.MDListener.execute(MDListener.java:466)
weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:371)
weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:327)
weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4547)
weblogic.jms.client.JMSSession.execute(JMSSession.java:4233)
weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3709)
weblogic.jms.client.JMSSession.access$000(JMSSession.java:114)
weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5058)
weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
[deadlocked thread] [ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)':
Thread '[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'' is waiting to acquire lock 'oracle.jdbc.driver.T4CConnection@b48b568' that is held by thread '[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)''
Stack trace:
oracle.sql.ARRAY.toBytes(ARRAY.java:673)
oracle.jdbc.driver.OraclePreparedStatement.setArrayCritical(OraclePreparedStatement.java:5985)
oracle.jdbc.driver.OraclePreparedStatement.setARRAYInternal(OraclePreparedStatement.java:5944)
oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:8782)
oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8278)
oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:8868)
oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:240)
weblogic.jdbc.wrapper.PreparedStatement.setObject(PreparedStatement.java:287)
org.springframework.jdbc.core.StatementCreatorUtils.setValue(StatementCreatorUtils.java:356)
org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(StatementCreatorUtils.java:216)
org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(StatementCreatorUtils.java:127)
org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.setValues(PreparedStatementCreatorFactory.java:298)
org.springframework.jdbc.object.BatchSqlUpdate$1.setValues(BatchSqlUpdate.java:192)
org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:892)
org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:1)
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:614)
org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:883)
org.springframework.jdbc.object.BatchSqlUpdate.flush(BatchSqlUpdate.java:184)
com.csfb.fao.rds.rfi.common.dao.storedprocs.SaveEarlyExceptionBatchStoredProc.execute(SaveEarlyExceptionBatchStoredProc.java:93)
com.csfb.fao.rds.rfi.common.dao.EarlyExceptionDAOImpl.saveEarlyExceptionBatch(EarlyExceptionDAOImpl.java:34)
com.csfb.fao.rds.rfi.application.rulesengine.RulesEngine.saveEarlyExceptions(RulesEngine.java:302)
com.csfb.fao.rds.rfi.application.rulesengine.RulesEngine.executeRules(RulesEngine.java:209)
com.csfb.fao.rds.rfi.application.rulesengine.RulesEngine.onMessage(RulesEngine.java:97)
com.csfb.fao.rds.feeds.process.BaseWorkerMDB.onMessage(BaseWorkerMDB.java:518)
weblogic.ejb.container.internal.MDListener.execute(MDListener.java:466)
weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:371)
weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:327)
weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4547)
weblogic.jms.client.JMSSession.execute(JMSSession.java:4233)
weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3709)
weblogic.jms.client.JMSSession.access$000(JMSSession.java:114)
weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5058)
weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Looking at the ARRAY.toBytes() method:
public byte[] toBytes()
throws SQLException
synchronized (getInternalConnection())
return this.descriptor.toBytes(this, this.enableBuffering);
..., it synchronizes on the following method (getInternalConnection() -> getPhysicalConnection()):
oracle.jdbc.internal.OracleConnection getPhysicalConnection()
if (this.physicalConnection == null)
try
this.physicalConnection = ((oracle.jdbc.internal.OracleConnection)new OracleDriver().defaultConnection());
catch (SQLException localSQLException)
return this.physicalConnection;
defaultConnection() does the following:
public Connection defaultConnection()
throws SQLException
if ((defaultConn == null) || (defaultConn.isClosed()))
synchronized (OracleDriver.class)
if ((defaultConn == null) || (defaultConn.isClosed()))
defaultConn = connect("jdbc:oracle:kprb:", new Properties());
return defaultConn;
So there's synchronizations on the connection instance and OracleDriver.class object... I can't see how this can deadlock. To get to the point of needing the lock on OracleDriver.class, the thread would already have the lock on the connection instance.... clearly I'm missing something.
Thanks
Edited by: 928154 on 17-Apr-2012 03:42

Welcome to the forum. If you want help, at least try to think where to post a question and look for a forum that matches the topic. Lets examine what you have:
- its Weblogic, so if you would ask a non-programming related question anywhere it would be in the Weblogic forum
- HOWEVER, if you check the top of the stacktrace, you'll see that the problem stems from the JDBC driver, so a JDBC related forum would be a closer match
For future reference, Weblogic specific questions should go here: https://forums.oracle.com/forums/category.jspa?categoryID=193
and JDBC/OJDBC driver related questions should go here: Java Database Connectivity (JDBC)
Final tip: use \ tags to post code so it is readable.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Problem Encountering in oracle.sql.ARRAY type

    Hi,
    i am using one stored procedure to get a set of records.
    i am getting it by mapping those things with java.sql.Array. And after that i am getting the values as ResultSet from that Array. The same thing is working fine in Windows platform. If i posted those thing into Unix - AIX, i am facing an ArrayIndexOutofBoundsException while getting ResultSet from oracle.sql.ARRAY class. I checked out ARRAY instance.it is not null. Both Application and Database are same except O.S.
    Can Anybody help me. I need it imm.
    Thanks in Advance
    Regards
    Eswaramoorthy.G

    Hi
    Did you ever figure out what the problem was with this? We have a client that is experiencing the same problem on AIX but we cannot reproduce using their database running under NT nor Sun. Any information would be appreciated. You can respond directly to [email protected]
    Thanks in adavance
    Rick DeMilia
    Sungard DataSystems

  • Java.sql.SQLException: Internal Error while using oracle.sql.ARRAY.getArray

    Hello All,
    Here is the issue description. Our application uses Oracle Object Types and LIST. We deployed our application on QA environment which has Oracle 10g. Application runs fine...no issues. Now we moved to UAT. UAT environment is same as QA environment and DBA have created replica of QA database.
    Now WAR file which works fine with QA database , somehow doesnt work with UAT database. Application throws following exception when code tries to call getArray() on java.sql.Array.
    We tried to point UAT weblogic to QA database and it worked fine.....but when we point UAT weblogic to UAT database , we get following exception. So we know that this is a database issue.
    DBA claims that QA env database and UAT env database are same.
    Can anybody please tell me what wrong here? What setting is not done on UAT database which is done on QA?
    java.sql.SQLException: Internal Error at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227) at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:975) at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1005) at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:96) at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:1958) at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1432) at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:426) at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:383) at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:928) at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:872) at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:692) at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:217) at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:189) at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:663) at oracle.sql.ARRAY.getArray(ARRAY.java:282) at weblogic.jdbc.wrapper.Array_oracle_sql_ARRAY.getArray(Unknown Source)
    Please help.

    425260 wrote:
    This can happen if you use the oracle.sql.ARRAY class with WebLogic.
    WebLogic wraps oracle.sql.ARRAY with its own class (i.e. weblogic.jdbc.wrapper.Array_oracle_sql_ARRAY). The easiest solution is to replace oracle.sql.ARRAY with the JDBC standard java.sql.Array.
    <PRE class=jive-pre><CODE class="jive-code jive-java">Object[] items = (Object[])array.getArray();
    <FONT color=navy><B>if</B></FONT> (items.length &gt; 0) <FONT color=navy>{</FONT>
    <FONT color=navy><B>for</B></FONT> (<FONT color=navy><B>int</B></FONT> i = 0; i &lt; items.length; i++) <FONT color=navy>{</FONT>
    Object arrayItem = items;
    <FONT color=navy>}</FONT>
    <FONT color=navy>}</FONT>
    </CODE></PRE>
    The <B>array</B> object is a java.sql.Array. Here no unwrapping of the WebLogic wrapper is needed.
    If you absolutely need the oracle.sql.ARRAY class than you must use an <B>unwrap</B> API on the WebLogic wrapper class.
    <PRE class=jive-pre><CODE class="jive-code jive-java"><FONT color=navy><B>if</B></FONT> (object <FONT color=navy><B>instanceof</B></FONT> weblogic.jdbc.wrapper.Array)
    array = (ARRAY) ( ((weblogic.jdbc.wrapper.Array)object).unwrap(Class.forName(<FONT color=red>"oracle.sql.ARRAY"</FONT>)) );
    <FONT color=navy><B>else</B></FONT>
    array = (ARRAY) object;
    </CODE></PRE>
    Here, <B>array</B> is an oracle.sql.ARRAY. Try to see if this <A class=bodylinkwhite href="http://www.software-to-convert.com/3gp-conversion-software/3gp-to-myspace-video-software.html"><FONT face=tahoma,verdana,sans-serif color=#000 size=1>helps</FONT></A>. Good luck.
    Thanks for your explanation! It's very valuable, It is exactly what I need, I understand this part.

  • Java.sql.SQLException: Internal Error: at oracle.sql.ARRAY.getArray(ARRAY.j

    hi all,
    I am getting the below exception
    Basically i am registering an out parameters like this
    cs.registerOutParameter(4, Types.ARRAY, "ISSUESECTION_LIST");
    my database version: oracle 11.1.0.7.0.
    I have created a synonym and given the execute privileges ,but also it comes up with the below exception
    java.sql.SQLException: Internal Error
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1026)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1056)
    at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:110)
    at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:2262)
    at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1656)
    at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:466)
    at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:416)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:979)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:923)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:743)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:242)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:208)
    at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:963)
    at oracle.sql.ARRAY.getArray(ARRAY.java:370)
    at com.db.gmr.eds.sm.jdbc.IssueSectionStoreJDBC.getResources(IssueSectionStoreJDBC.java:69)
    at com.db.gmr.eds.handler.GetResources.handle(GetResources.java:126)
    at com.db.gmr.eds.servlet.PageController.handle(PageController.java:138)
    at com.db.gmr.eds.servlet.PageController.doGet(PageController.java:80)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at com.db.gmr.core.servlet.filters.TomcatParameterBugFix.doFilter(TomcatParameterBugFix.java:65)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:500)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
    at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:775)
    at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:704)
    at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:897)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Thread.java:619)
    If i use cs.registerOutParameter(4, Types.ARRAY, "SCHEMA_OWNER_NAME.ISSUESECTION_LIST"); Then i wont be getting the error.
    COULD ANYONE LET ME KNOW THE WORK AROUND OTHER THAN THE ABOVE SOLUTION LIKE ADDING THE OWNER SCHEMA NAME WITH THE USER DEFINED COLLECTION TYPE.

    There couold be two reasons:
    1) it depends how u have defined type. if ISSUESECTION_LIST is defined in type SCHEMA_OWNER, then you have to call this ways only 'SCHEMA_OWNER_NAME.ISSUESECTION_LIST'
    2) You might have defined using schema_owner_name like scott.<TYPE_NAME>. if its so, then drop it and again define type without using schema owner.
    For detail help post your type declaration.

  • Java.sql.SQLException: Internal Error with oracle.sql.ARRAY getArray()

    hi,
    I am having having problems with the getArray() of oracle.sql.ARRAY.
    Here are the details:
    Oracle Database - 9.2.0.6. The JDBC driver used -10.2.0.1 jar.(the latest available).
    I am calling a stored procedure from java, that has out param as a collection (VARRAY) of a user defined type.
    The stored procedure works fine, if the user/schema used to connect,contains actual type, and i am able to extract the user defined object from the oracle.sql.ARRAY, via getArray().
    But if i use a different user to connect which has public synonyms and execute rights to the actual type, i get the following error:
    java.sql.SQLException: Internal Error
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1026)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1056)
         at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:110)
         at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:2262)
         at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1656)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:466)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:416)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:979)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:923)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:743)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:242)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:208)
         at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:963)
         at oracle.sql.ARRAY.getArray(ARRAY.java:370)
    The problem is happening because we have 2 different users to connect to the database. one is the dba user, which contains all the types, packages and other one the application user, which we are supposed to use, to connect via java. This application user does have access to types via public synonym, but it gives the above mentioned error.
    Please help :(.
    Regards,
    Gaurav.

    Hi avi,
    Even I am getting the same error inspite of preceding the type name with the same user who has created the type.
    It has displayed the array length.When I am trying to fetch each array, I am getting the error.
    ARRAY simpleArray = (ARRAY) cs.getObject(3);          
    System.out.println("Array is of length " + simpleArray.length());          ********************** The above stmt prints 2 records ******************
    But it goes to exception in the foll stmt..
    Object [] objArrStructArray = null;
    try{
         objArrStructArray = (Object[]) simpleArray.getArray();
    }catch(SQLException e){
         e.printStackTrace();
    Do u know abt this?
    The foll is the error which I am getting.
    java.sql.SQLException: Internal Error
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1026)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1056)
         at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:110)
         at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:2262)
         at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1656)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:466)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:416)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:979)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:923)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:743)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:242)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:208)
         at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:963)
         at oracle.sql.ARRAY.getArray(ARRAY.java:353)
         at com.telstra.plo.data.NetworkDAO.findCablesInBuffer(NetworkDAO.java:730)
         at com.telstra.plo.data.NetworkDAOTest.testFindCablesInBuffer(NetworkDAOTest.java:45)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Thanks
    Archana

  • NullPointer from constructor of oracle.sql.ARRAY

    This is a strange one, I'm hoping someone has seen this before.
    I'm seeing a nullpointer exception from the contructor of ARRAY(ArrayDescriptor, Connection, Object)
    This occurs when I'm trying to make a call from an application module to a stored procedure with custom database types.
    This seems to work fine in the embedded OC4J instance but fails when deployed to an application server on linux. The version is 10.1.2.
    thanks for your help.
    Joel
    Here is the part of the stack trace:
    java.lang.NullPointerException
         at oracle.jdbc.driver.PhysicalConnection.isDescriptorSharable(PhysicalConnection.java:5078)
         at com.evermind.sql.OracleConnectionBCELProxy__oracle_jdbc_driver_T4CConnection__SQLBCELProxy.isDescriptorSharable()
         at oracle.sql.ARRAY.<init>(ARRAY.java:118)
         at fastenal.website.model.services.products.ProductsServiceImpl.getPrices(ProductsServiceImpl.java:121)
    and relevant source code:
    public ProductPrices[] getPrices(String[] skus, Number accountNumberId, Number userId, Number catalogId){
    OracleCallableStatement st = null;
    try {
    Connection con = getCurrentConnection();
    System.out.println(con.getClass().toString() );
    // Create the type object
    Map map = con.getTypeMap();
    //map.put("SKU_DETAIL_TYPE", Class.forName("fastenal.integration.ws.products.ProductDetailSqlType"));
    map.put("WEB_PRICE_TYPE", ProductPriceSqlType.class);
    con.setTypeMap(map);
    ProductPriceSqlType[] pricesSql = new ProductPriceSqlType[skus.length];
    for (int i = 0; i < skus.length; i++) {
    pricesSql[i] = new ProductPriceSqlType("WEB_PRICE_TYPE", 0d, 0d, 0d, skus, null);
    //ProductDetailSqlType productsSQL = new
    ArrayDescriptor arrayDesc = ArrayDescriptor.createDescriptor("WEB_PRICE_TYPE_ARRAY", con);
    ARRAY prices = new ARRAY(arrayDesc, con, pricesSql);
    st = (OracleCallableStatement)getDBTransaction().createCallableStatement( PRICING_PLSQL
    , DBTransaction.DEFAULT);
    st.registerOutParameter(1, Types.ARRAY, "WEB_PRICE_TYPE_ARRAY");
    st.setARRAY(2, prices);
    //st.setString(3, strAccountNumber);
    if (accountNumberId!=null){
    st.setInt(3, accountNumberId.intValue() );
    }else{
    st.setNull(3, Types.NUMERIC );
    if (userId!=null){
    st.setInt(4, userId.intValue() );
    }else{
    st.setNull(4, Types.NUMERIC );
    if (catalogId!=null){
    st.setInt(5, catalogId.intValue() );
    }else{
    st.setNull(5, Types.NUMERIC );
    st.execute();
    prices = st.getARRAY(1);
    Object[] retVals = (Object[])prices.getArray();
    ProductPrices[] prodPrices = new ProductPrices[retVals.length];
    for (int i = 0; i < retVals.length; i++) {
    ProductPrices currPrices = new ProductPrices();
    ProductPriceSqlType sqlType = (ProductPriceSqlType)retVals[i];
    Double customPrice;
    if (sqlType.getCustomPrice()!=null){
    customPrice = new Double(sqlType.getCustomPrice().doubleValue() );
    }else{
    customPrice=null;
    Double promoPrice;
    if (sqlType.getPromoPrice()!=null){
    promoPrice = new Double(sqlType.getPromoPrice().doubleValue() );
    }else{
    promoPrice=null;
    Double wholeSalePrice;
    if (sqlType.getWholeSalePrice()!=null){
    wholeSalePrice = new Double(sqlType.getWholeSalePrice().doubleValue() );
    }else{
    wholeSalePrice=null;
    currPrices.setCustomPrice( customPrice );
    currPrices.setPromotionalPrice(promoPrice );
    currPrices.setWholesalePrice(wholeSalePrice);
    currPrices.setSku(sqlType.getSku());
    currPrices.setPromoEndDate(sqlType.getPromoEndDate());
    prodPrices[i] = currPrices;
    }//end for
    return prodPrices;
    }catch (SQLException s) {
    throw new JboException(s);
    }//end catch
    finally {
    if (st != null) try { st.close(); } catch (SQLException s2) {}
    }//end finally
    * Helper method to get the current connection.
    * As specified by
    * re:BC4J: How get Connection from Application Module
    * @return
    private Connection getCurrentConnection() {
    Statement st = null;
    try {
    st = getDBTransaction().createStatement(0);
    return st.getConnection();
    catch (SQLException s) {
    s.printStackTrace();
    return null;
    finally {
    if (st != null) try { st.close(); } catch (SQLException s2) {}

    Avi, thanks for your response. The connection is obtained from a BC4J appmod, which ultimately comes from a pooled datasource.
    When I look at the implementation class in the embeded OC4J environment it is com.evermind.sql.OracleConnectionBCELProxy__com_evermind_sql_OrionCMTConnection__SQLBCELProxy. The call to ARRAY works in this environment.
    On the application server the runtime implementation of the connection is com.evermind.sql.ConnectionBCELProxy__com_evermind_sql_OrionCMTConnectionFinalize__SQLBCELProxy. This fails with the exception in the original post.
    In both environments I can successfuly cast to an OracleConnection so I'm pretty sure both implementaion classes are subclasses of OracleConnection.
    Both environments are 10.1.2.
    thanks for your help so far.
    jk

  • Oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray

    Hi,
    I am facing following issue in my one environment. but in other environment same class path is working fine. I have compared all jar and classpath for both weblogic server.
    I am using weblogic 11g.
    27 Mar 2013 15:21:09,507 ERROR XXXServlet:293 - oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray
    java.lang.ClassCastException: oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray
    at com.emc.nems.wsd.ui.beans.reports.mpapi.FacilityBeanType.nullSafeGet(FacilityBeanType.java:126)
    at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:128)
    at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
    at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2114)
    at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404)
    at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332)
    at org.hibernate.loader.Loader.getRow(Loader.java:1230)
    at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
    at org.hibernate.loader.Loader.doQuery(Loader.java:724)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
    at org.hibernate.loader.Loader.doList(Loader.java:2232)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
    at org.hibernate.loader.Loader.list(Loader.java:2124)
    at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
    at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1723)
    at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
    at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
    at com.emc.nems.oms.dao.hibernate.util.OMSHibBaseDAO.executeNamedQueryWithoutTransaction(Unknown Source)
    at com.emc.nems.wsd.dao.hibernate.reports.mpapi.MpapiReportHibDAO.findMCR020(Unknown Source)
    at com.emc.nems.wsd.ui.handler.reports.ReportsHandler.getMPAPIData(Unknown Source)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.executeReport(XXXServlet.java:1009)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.generateAuditFile(XXXServlet.java:318)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.execute(XXXServlet.java:273)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.doGet(XXXServlet.java:207)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3731)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3695)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2285)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2184)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1459)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Regards,
    Abhishek

    Creating my Oracle connection works fine ... code as follows:
    <i>Context ctxt = getInitialContext();
    DataSource dataSource = (DataSource) ctxt.lookup(poolName);
    Connection conn = dataSource.getConnection();
    OracleConnection oracleConn = (OracleConnection)((WLConnection)conn).getVendorConnection();</i>
    I also have reviewed documentation:
    http://e-docs.bea.com/wls/docs81/jdbc/thirdparty.html. In section 'Using OracleStruct Extension Methods' it highlights that
    <i>java.sql.Struct struct =(weblogic.jdbc.vendor.oracle.OracleStruct)(rs.getObject(2));</i>
    None of the documentation actually mentions <b>oracle.sql.STRUCT</b>. For Weblogic to truely provide support for Oracle it needs an easy way of converting to this data type. At present I cannot interact with Oracle APIs until I can create an oracle.sql.STRUCT.

  • Conversion of java Array to oracle SQL Array while calling Stored Procedure

    How java Array can be converted to oracle SQL array while calling Stored procedure with callable statement.
    i.e java Array ---> Sql Array in Oracle while setting the datatypes to callable statement arguments.

    Look at:
    http://forum.java.sun.com/thread.jsp?forum=48&thread=376735&tstart=0&trange=15
    Paul

  • How to create oracle.sql.array

    I need to create an oracle.sql.array to pass in my custom objects array to the database. I know you can create it using the ArrayDescriptor class but the problem with that is the connection object is need.
    I am using the writeSql() method of the SQLData interface. I therefore dont have the connection object. Any ideas?

    haha
    you misunderstand. i have in my code:
    <code>
         // update the organisation
         public boolean setOrganisation(Organisation pOrg) {
              Organisation org = pOrg;
              OracleCallableStatement callStat = null;
              Connection conn = null;
              boolean OK = false;
              try {
                   conn = getConnection(getUserName());
                   pOrg.setConnection(conn);
                   callStat = (OracleCallableStatement) conn.prepareCall("{call p_cmt.update_organisation(?)}");
                   callStat.setObject(1, org);
                   callStat.execute();
                   OK = true;
              } catch (Exception e) {
                   logger.severe("error writing organisation with id " + org.getId() + ". " + e);
              } finally {
                   cleanUpConnections(conn, callStat);
              return OK;
    </code>
    This writes the object organisation to the database. Now in the class organisation i have the following method which is called automatically when writing the organisation object to the database:
    <code>
         public void writeSQL(SQLOutput p_stream) throws SQLException {
              p_stream.writeInt(id);
              p_stream.writeObject(country);
         if (finIndexArr == null)
              finIndexArr = new ListElement[0];
         ArrayDescriptor af = ArrayDescriptor.createDescriptor(
         ObjectMapper.elementList, conn);
         ARRAY arr = new ARRAY(af, conn, finIndexArr);          
              p_stream.writeArray(arr);
    </code>
    The problem is the last bit. To put the finIndexArr into an array i need the connection object. So i have to pass into the organisation object the connection object which seems unneccessary and pointless to me. I was just looking at an alternative way of creating the array without the need of the connection object. Since the setOrganisation() above has the connection to the database i dont see why i need to specify it in the array as well

  • Problem passing oracle.sql.ARRAY to Oracle

    I am having ClassCastException when I try to pass a oracle.sql.ARRAY to a Oracle Package.
    Here is my code:
    PreparedStatement stmt = null;
    String strArray[] = { "1,2,3,4,5" };
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor( "TEST_PAC_1.TEST_COLL_2", dbConnection );
    //encounter Exception on the line below.
    ARRAY array_to_pass = new ARRAY( descriptor, dbConnection, strArray );
    String queryStr = "begin TEST_PAC_1.TEST_PROC_2(?); end;";
    stmt = dbConnection.prepareStatement(queryStr);
    stmt.setArray( 1, array_to_pass );
    stmt.execute();
    I understand that oracle.sql.ARRAY has been replaced by weblogic.jdbc.vendor.oracle.OracleArray in Weblogic.
    MY QUESTION IS: HOW DO I INSERT MY STRING ARRAY INTO THE OracleArray and pass it to the plsql.
    Really frustrated searching through the forums for the whole day,
    Thanks,

    Try this if you are at weblogic 8.1:
    Connection con = getConnectionFromDataSource();
    Connection vendorConnection = ((WLConnection)con).getVendorConnection();
    // use direct oracle connection.
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor( "TEST_PAC_1.TEST_COLL_2", dbConnection );
    vendorConnection.close();
    Beware that you should be very careful as you are going to use a direct vendor
    connection.
    The better aproach is to pass the string array as a delimited string to your storad
    procedure and parse it in the SP - then you don't have to mess up with vendor-specific
    handling.
    Hope this helps.
    Regards,
    Slava Imeshev
    "Daddy Daddy" <[email protected]> wrote in message news:24349835.1097143668312.JavaMail.root@jserv5...
    I am having ClassCastException when I try to pass a oracle.sql.ARRAY to a Oracle Package.
    Here is my code:
    PreparedStatement stmt = null;
    String strArray[] = { "1,2,3,4,5" };
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor( "TEST_PAC_1.TEST_COLL_2", dbConnection );
    //encounter Exception on the line below.
    ARRAY array_to_pass = new ARRAY( descriptor, dbConnection, strArray );
    String queryStr = "begin TEST_PAC_1.TEST_PROC_2(?); end;";
    stmt = dbConnection.prepareStatement(queryStr);
    stmt.setArray( 1, array_to_pass );
    stmt.execute();
    I understand that oracle.sql.ARRAY has been replaced by weblogic.jdbc.vendor.oracle.OracleArray in Weblogic.
    MY QUESTION IS: HOW DO I INSERT MY STRING ARRAY INTO THE OracleArray and pass it to the plsql.
    Really frustrated searching through the forums for the whole day,
    Thanks,

  • Oracle defined array type

    Hi,
    I am trying to pass an input parameter to a stored procedure as oracle defined array type. The input parameter will be stored as an array_varchar type which is defined by our own in our oracle 9i. Can anyone tell me how ? I've been looking for solution for 2 days and still dont know how.
    Thanks.
    yves

    The solution described in Passing Array of UDT or Collection as IN OUT using OracleDbType.InputOutput
    is working for me.
    Edited by: stzueger on Jan 2, 2012 10:32 AM

  • Error of passing of oracle.sql.ARRAY in PL/SQL function at work under OC4J

    Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)
    Error occured at working with DataSource based on com.evermind.sql.DriverManagerDataSource and oracle.jdbc.pool.OracleDataSource.
    Error:
    java.lang.AbstractMethodError: com.evermind.sql.OrclCMTConnection.physicalConnectionWithin()Loracle
    /jdbc/internal/OracleConnection;
    at oracle.sql.TypeDescriptor.setPhysicalConnectionOf(TypeDescriptor.java:660)
    at oracle.sql.TypeDescriptor.<init>(TypeDescriptor.java:212)
    at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:376)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:237)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:192)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:177)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:114)
    What to do?
    Thank you.

    The issue is resolved by change classes12dms.jar for OC4J. The jdbc driver was changed from version (read from manifest):
    Manifest-Version: 1.0
    Specification-Title: Oracle JDBC driver classes for use with JDK12
    Created-By: 1.4.2_08 (Sun Microsystems Inc.)
    Implementation-Title: classes12dms_g.jar
    Specification-Vendor: Oracle Corporation
    Specification-Version: Oracle JDBC Driver version - "10.2.0.1.0"
    Implementation-Version: Oracle JDBC Driver version - "10.2.0.1.0"
    Implementation-Vendor: Oracle Corporation
    Implementation-Time: Wed Jun 22 19:11:35 2005
    to:
    Manifest-Version: 1.0
    Name: javax/sql/ConnectionEvent.class
    Digest-Algorithms: SHA MD5
    SHA-Digest: GQ5KFq39ybZzmgVThMOVSb6DDL8=
    MD5-Digest: uryrGtwsbgYBwoQDl0I85A==
    Name: javax/sql/ConnectionEventListener.class
    Digest-Algorithms: SHA MD5
    SHA-Digest: gh9/m94g05tRid8f4mhmEnJ5als=
    MD5-Digest: x63DZ5tPqdiCaLP0z1GHew==
    Probably the Oracle has compiled OC4J with other version of this library.

  • Oracle.sql.ARRAY error "Non supported character set: oracle-character-set-"

    Hi Folks,
    I am getting error :
    java.sql.SQLException: Non supported character set: oracle-character-set-178
    at oracle.gss.util.NLSError.throwSQLException(NLSError.java:46)
    in the following code :
    Object[] arrayToPassToDB=new Object[7];
    ArrayDescriptor arraydesc = ArrayDescriptor.createDescriptor(arrayDesc,con);
    ARRAY array = null;
    array = new ARRAY(arraydesc, con, arrayToPassToDB);
    i am using jdk1.6 and oracle 10g.
    I have copied the orai18n.jar and ojdbc6.jar in WEB-INF\lib directory of my project and also in the Tomcat\lib directory.
    can you please help me?
    Thanks in advance.

    java.sql.SQLException: Non supported character set:oracle-character-set-178

  • How to create Array type parameter of Oracle 10.2.0.1.0 in java

    I create a collection type with:
    CREATE OR REPLACE
    type TEST_User.T_ARRAY AS TABLE OF VARCHAR2(100);
    and in java code, I use following code to create a parameter of this type, and set it for a procdure
    String[] userMakeArray = new String[]{"V", "N", "A"};
    oracle.sql.ArrayDescriptor descriptor = oracle.sql.ArrayDescriptor.createDescriptor("TEST_User.T_ARRAY", cn); // cn is connection instance to database
    oracle.sql.ARRAY array = new oracle.sql.ARRAY(descriptor, cn, userMakeArray);
    ((oracle.jdbc.OracleCallableStatement)call).setArray(8, array);
    when i use this to call procedure in Oracle 10.1, it work well.
    In Oracle 10.2, it does not work well.
    For test, I can execute procedure well in sql plus, but in java client, I found that array contains three items "Null", while array is correct when conect to 10.1 enviroment.
    does anybody know what's the reason for this.
    thanks a lot.

    Hi,
    Too long to copy/paste here but i have a simpler working example of Nested Table of VARCHAR2 type against 10.2.0.x, in chapter 3 and 8 of my book:
    create or replace type NTab_Vc2 as TABLE of varchar2(30)
    create table NSTableTab (id int, numnt NTab_Num, vc2nt NTab_Vc2, datnt
    NTab_Dat)
    nested table numnt store as NSTabNum,
    nested table vc2nt store as NSTabVc2,
    nested table datnt store as NSTabDat;
    insert into NSTableTab values (1,
    NTab_Num(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
    NTab_Vc2 ('One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten'),NTab_Dat('01-JAN-2003', '02-JAN-2003', '03-JAN-2003', '04-JAN-2003',
    '05-JAN-2003', '06-JAN-2003', '07-JAN-2003', '08-JAN-2003',
    '09-JAN-2003', '10-JAN-2003')
    // The following code snippet retrieves and returns a
    // NTab_Vc2 as a java.sql.Array
    OraclePreparedStatement ps = (OraclePreparedStatement)
    conn.prepareStatement ("SELECT VC2NT FROM NSTableTab
    WHERE ID = ?");
    ps.setNUMBER (1, id[0]);
    OracleResultSet rs = (OracleResultSet) ps.executeQuery();
    Array a = null;
    while (rs.next())
    a = (Array) rs.getObject(1);
    ps.close();
    return a;
    Kuassi, http://db360.blogspot.com/2006/08/oracle-database-programming-using-java_01.html

  • Oracle.sql.BLOB array

    Hi,
    I have a database table(say MY_BLOB_TABLE.) having one blob column
    I want to send each blob column as an attachment to a single email i.e. I for a particular case if I have 10 qualifying rows in MY_BLOB_TABLE,I want to send all these 10 blobs as different attachments with a SINGLE email.
    I have the working code (from asktom) that allows me to send one attchment per email ..so I changed the code so that it takes array types to the things..
    here is my code:
    Database Type:
    create or replace type xx_blobdata is varray(50) of blob;
    create or replace type xx_attachedfile is varray(50) of varchar2(1000);
    create or replace type xx_attachedfiletype is varray(50) of varchar2(1000);
    Java Code
    public class xx_attachments_mail
    static String dftMime = "application/octet-stream";
    static String dftName = "filename.dat";
    public static oracle.sql.NUMBER
    send(String from,
    String to,
    String cc,
    String bcc,
    String subject,
    String body,
    String SMTPHost,
    oracle.sql.BLOB[] attachmentData,
    String[] attachmentType,
    String[] attachmentFileName);
    PLSQL Wrapper
    create or replace function xx_attachments_mail_send(
    p_from in varchar2,
    p_to in varchar2,
    p_cc in varchar2,
    p_bcc in varchar2,
    p_subject in varchar2,
    p_body in varchar2,
    p_smtp_host in varchar2,
    p_attachment_data in xx_blobdata,
    p_attachment_type in xx_attachedfiletype,
    p_attachment_file_name in xx_attachedfile) return number
    as
    language java name 'xx_attachments_mail.send( java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    oracle.sql.BLOB[],
    java.lang.String[],
    java.lang.String[]
    ) return oracle.sql.NUMBER';
    Actual Call:
    attachment_data :=xx_blobdata();
    attachment_type :=xx_attachedfiletype();
    attachment_name :=xx_attachedfile();
    ret_code := xx_attachments_mail_send(
    p_from => '[email protected]',
    p_to => '[email protected]',
    p_cc => NULL,
    p_bcc => NULL,
    p_subject => 'testing',
    p_body => 'testing..',
    p_smtp_host => 'myserver.com',
    p_attachment_data => attachment_data,
    p_attachment_type => attachment_type,
    p_attachment_file_name => attachment_name);
    Everything compiles. All objects are valid in database.But when I call I get the following error:
    ORA-29531: no method send in class xx_attachments_mail
    ORA-06512: at "XX_ATTACHMENTS_MAIL_SEND", line 1
    Can anybody point out what is wrong that I am doing.
    Thanks.

    Its already there...
    public static oracle.sql.NUMBER send();
    The code works well if I remove arrays (i.e. []) ... my problem is the mapping or VARRAY to Java datatype...
    I just read something on oracle.sql.array ....that is the solution for mapping Oracle VARRAY to Java data type... but still I dont have a working code...
    Any help is highly appreciated...

Maybe you are looking for

  • Problems transfering iTunes Media folder from one external HDD to another.

    Hey Yinz. I'm running a MBP 13" 2.7Ghz Intel Core i7...OS X 10.6.8.  Recently the NAS that hosted my iTunes Media folder and library failed.  I recovered the drive from the NAS...a WD Caviar (WD2500JS), which was originally written in XFS.  After sub

  • Can't configure sync my contacts & calendar on iTunes (10.1.0.56)

    The ability to configure Sync my contacts is not avaliable. When I select sync my contacts the configure button does not respond. As for Sync my calendars - this one I even can't select, the option to select the check box is disabled. I have iPhone 4

  • PLS -00428-- an INTO clause is expected in the SELECT statement

    I dnt know what i'm doing wrong with statement, can you help me please. DECLARE start_date DATE:= to_date('01/09/2006' , 'DD-MON-YYYY'); end_date DATE:= to_date('30/09/2006' , 'DD-MON-YYYY'); BEGIN SELECT t.SEC_SHORT_NAME, t.SEC_ISIN, t.SEC_NO,t.SEC_

  • Clear Signature

    Got a question about the "Clear Signature": suppose I have a stand-alone (a pdf file, not in the WorkSpace) PDF form with 2 Signature fields, each Signature locks a few fields on the form, user A signs his Signature, gives the PDF file to user B, and

  • Trial Download VS Retail

    Hi All, What is the difference between Aperture trial Download (~500megs) and the Retail CD (~6gigs)? Thanks, B