13 Replies Latest reply: Apr 13, 2013 2:41 AM by 1002862 RSS

    OJDBC14 problem


      Looks like I ran across some sort of a bug in the thin driver (ojdbc14.jar).
      Everything is working perfectly with the classes12.jar. I have a semi-complex stored procedure, which takes in a combination of about 20 IN and IN OUT custom type objects and arrays.
      The data gets written to the database (at least partially), but I get the following exception:

           at oracle.jdbc.driver.T4CNamedTypeAccessor.unmarshalOneRow(T4CNamedTypeAccessor.java:137)
           at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:792)
           at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:708)
           at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:530)
           at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:181)
           at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(T4CCallableStatement.java:870)
           at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1081)
           at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2905)
           at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:2996)
           at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4120)
           at org.apache.commons.dbcp.DelegatingCallableStatement.execute(DelegatingCallableStatement.java:269)

      I also tried using the thin driver, but no luck - same issue arises.

      Any ideas?

      Serge B
        • 1. Re: OJDBC14 problem
          Avi Abrami
          The Apache Commons Database Connection Pool may wrap the Oracle database connection object. You may need to use the actual Oracle database connection. Did you try your code using a database connection obtained directly (and not via DBCP)?

          Good Luck,
          • 2. Re: OJDBC14 problem
            Hi Avi.

            Here is the line of code from the commons DelegatingCallableStatement class:

            public boolean execute() throws SQLException { return _stmt.execute();  }

            where _stmt is just a delegate:
            protected CallableStatement _stmt = null;

            This looks like some sort of a bug in the oracle thin driver for java 1.4, which is triggered in certain cases only. I'm using arrays and custom types through the application and it is ok. This issue only started to occur ones I upgraded to ojdbc14.jar. I'm hoping someone from oracle would pick this message up.

            • 3. Re: OJDBC14 problem
              Avi Abrami
              If you want to report a bug in Oracle's JDBC driver, then you can use MetaLink.

              You aren't guaranteed of someone from Oracle picking up your message. These forums aren't necessarily monitored by Oracle employees.

              Good Luck,
              • 4. Re: OJDBC14 problem
                This is correct this forum is not monitored sustainedly.

                This sounds like a bug however, for JDBC development to bouge, we need Support to validate that this is indeed a bug with a reproducible test case.

                • 5. Re: OJDBC14 problem

                  Does anyone happen to know the status on this ? We are experiencing the same problem.

                  thanks much,

                  todd kegley
                  • 6. Re: OJDBC14 problem
                    Avi Abrami
                    You can always check MetaLink.

                    Good Luck,
                    • 7. Re: OJDBC14 problem
                      (Sorry for my poor English ;D)

                      I get the same problem, and you are wrong with the origin of the problem.
                      It´s not due to the ojdbc14 because i use it with an oc4j 9 and works well, the problem comes when i migrate the aplicaction to an oc4j 10.1.2, i had a semi-complex param declared as IN OUT and the java code doesn´t register the param as OUT only as IN, so while oc4j 9 don´t arise any exception, oc4j 10.1.2 throws your exception.

                      The param was an STRUCT than contains a VARCHAR and two ARRAYS.

                      The problem fixed declaring the param only as IN, because it was a mistake.

                      Good luck,
                      Victor Gimeno.
                      • 8. Re: OJDBC14 problem

                        does anyone have an update on this. I encountered the same problem and I am unable to resolve it. The stored procedure is part of a large system and changing it would cost a lot. Please let me know if anyone found a solution to this.

                        FYI, I am pasting the error I am getting

                        Exception in thread "main" java.lang.NullPointerException
                             at oracle.jdbc.driver.T4CNamedTypeAccessor.unmarshalOneRow(T4CNamedTypeAccessor.java:146)
                             at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:919)
                             at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:843)
                             at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:619)
                             at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:211)
                             at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:950)
                             at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1159)
                             at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3284)
                             at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3389)
                             at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4222)
                             at org.jtdemo.CreateDataSet.callCreateDataset1(CreateDataSet.java:501)
                             at org.jtdemo.Main.main(Main.java:44)

                        Thanks in advance
                        • 9. Re: OJDBC14 problem
                          A test code that reproduces the problem is needed to investiguate.

                          • 10. Re: OJDBC14 problem
                            I had the same problem and I worked it around by not using IN OUT parameters of complex type, only IN parameters and return just few scalar values that I needed.

                            Maybe this helps. Search in Metalink for "unmarshalOneRow" gave no results.

                            • 11. Re: OJDBC14 problem
                              Hello! I have the same problem and I think that I have a temporal solution.

                              The problem is that a STRUCT used for IN and OUT is not registered as OUT parameter. The solution that I found is register the same object first as IN (with setObject();) and then as OUT (with registerOutParameter();).

                              That works for me, I hove it will help.
                              • 12. Re: OJDBC14 problem
                                Hi Guys

                                I had a similar issue while calling a proc which has Array of nested tables as one of the parameter.
                                The parameter is declared as IN OUT as I am using the table to store the primary keys generated after creating new records.

                                The code was working fine with the 9i driver. Below is the Manifest version from the ojdbc14.jar
                                Manifest-Version: 1.0
                                Specification-Title: "Oracle JDBC driver classes for use with JDK1.4"
                                Specification-Version: "Oracle JDBC Driver version -"
                                Specification-Vendor: "Oracle Corporation" .
                                Implementation-Title: "ojdbc14.jar"
                                Implementation-Version: "Oracle JDBC Driver version -"
                                Implementation-Vendor: "Oracle Corporation"
                                Implementation-Time: "Fri Jun 9 04:31:01 2006"

                                The same code fails with the driver and throws the following error and also fails to rollback the transaction.
                                     at oracle.jdbc.driver.T4CNamedTypeAccessor.unmarshalOneRow(T4CNamedTypeAccessor.java:147)
                                     at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:941)
                                     at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:865)
                                     at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:620)
                                     at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215)
                                     at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:954)
                                     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
                                     at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
                                     at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390)
                                     at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4223)
                                     at org.springframework.jdbc.core.JdbcTemplate$5.doInCallableStatement(JdbcTemplate.java:906)
                                     at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:872)
                                     at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:904)
                                     at org.springframework.jdbc.object.StoredProcedure.execute(StoredProcedure.java:113)

                                The issue got fixed after I download the latest drivers from [http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html]
                                • 13. Re: OJDBC14 problem
                                  Hi Friends,

                                  I faced similar problem, But the problem i had is, I am using wrong mode of parameter at DB. At stored proc level i am using OUT and i am passing as IN from Java code, So just changing the mode to IN at Strored Proc solved my problem.


                                  Edited by: 999859 on 13-Apr-2013 00:40