You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by garpinc <ga...@yahoo.com> on 2012/08/28 15:27:10 UTC

oracle clob exception

I'm trying to save clob to oracle in JPA in osgi environment and getting
following exception. Does anyone have any ideas?:

Caused by: java.sql.SQLException: oracle.sql.CLOB
	at
org.apache.openjpa.jdbc.sql.OracleDictionary.getEmptyClob(OracleDictionary.java:1232)
	at
org.apache.openjpa.jdbc.sql.OracleDictionary.setNull(OracleDictionary.java:636)
	at
org.apache.openjpa.jdbc.sql.DBDictionary.setTyped(DBDictionary.java:1257)
	at org.apache.openjpa.jdbc.sql.RowImpl.flush(RowImpl.java:896)
	at org.apache.openjpa.jdbc.sql.RowImpl.flush(RowImpl.java:856)
	at
org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushBatch(BatchingPreparedStatementManagerImpl.java:166)




--
View this message in context: http://openjpa.208410.n2.nabble.com/oracle-clob-exception-tp7580960.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: oracle clob exception

Posted by garpinc <ga...@yahoo.com>.
Using eclipse osgi environment (equinox)



--
View this message in context: http://openjpa.208410.n2.nabble.com/oracle-clob-exception-tp7580960p7580977.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: oracle clob exception

Posted by Kevin Sutter <kw...@gmail.com>.
*>  The uniqueness of my situation is that i'm running in OSGI environment..
*

You probably hit the nail on the head...  I didn't see your connection
between the loading of the oracle.sql package and the osgi classloading
environment.  It's probably dependent on your osgi environment.  The
current context classloader seems to work in WebSphere's osgi runtime for
loading these oracle classes, but this wouldn't be the first disconnect
between various osgi environments.  Which osgi runtime are you running with?

I would suggest opening a JIRA.  Since you have a workaround, you can make
progress.

Thanks,
Kevin

On Wed, Aug 29, 2012 at 10:36 AM, garpinc <ga...@yahoo.com> wrote:

> I'm using version 2.2.0.
>
> The uniqueness of my situation is that i'm running in OSGI environment..
>
> Basically I have a database bundle which has all the drivers and provides a
> service the can supply a jdbc DataSource.
>
> oracle.sql package is not exported.
>
> Then I have a client bundle that configures OpenJPA with a datasource
> provided by that service.
>
> In order to not get the described exception I had to do an optional
> dependency on the oracle.sql package which is not ideal since now the
> client
> bundle has to know about the oracle driver bundle.
>
> So I'm looking for some kind of workaround in JPA that would use the
> DataSource class path instead to find the oracle.sql.CLOB object..
>
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/oracle-clob-exception-tp7580960p7580971.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Re: oracle clob exception

Posted by garpinc <ga...@yahoo.com>.
I'm using version 2.2.0.

The uniqueness of my situation is that i'm running in OSGI environment..

Basically I have a database bundle which has all the drivers and provides a
service the can supply a jdbc DataSource. 

oracle.sql package is not exported.

Then I have a client bundle that configures OpenJPA with a datasource
provided by that service.

In order to not get the described exception I had to do an optional
dependency on the oracle.sql package which is not ideal since now the client
bundle has to know about the oracle driver bundle.

So I'm looking for some kind of workaround in JPA that would use the
DataSource class path instead to find the oracle.sql.CLOB object..



--
View this message in context: http://openjpa.208410.n2.nabble.com/oracle-clob-exception-tp7580960p7580971.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: oracle clob exception

Posted by Kevin Sutter <kw...@gmail.com>.
The referenced JIRA (openjpa-542) should only be related if you are running
an extremely old version of OpenJPA...  :-)  What version of OpenJPA are
you running?

Is there more to the exception?  Any additional error codes, etc from
Oracle?  Since we have JUnits and other tests that seem to be working with
Oracle and CLOBs, you might have to help figure out the uniqueness to your
scenario.  Like writing a JUnit to demonstrate the problem.  There just
isn't enough information to formulate a better response...

Thanks,
Kevin

On Tue, Aug 28, 2012 at 8:35 AM, garpinc <ga...@yahoo.com> wrote:

> It maybe related to https://issues.apache.org/jira/browse/OPENJPA-542:
>
>             return EMPTY_CLOB = (Clob)
> Class.forName("oracle.sql.CLOB",true,
>                     AccessController.doPrivileged(J2DoPrivHelper
>                             .getContextClassLoaderAction())).
>                 getMethod("empty_lob", new Class[0]).
>                 invoke(null, new Object[0]);
>
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/oracle-clob-exception-tp7580960p7580961.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Re: oracle clob exception

Posted by garpinc <ga...@yahoo.com>.
It maybe related to https://issues.apache.org/jira/browse/OPENJPA-542:

            return EMPTY_CLOB = (Clob) Class.forName("oracle.sql.CLOB",true, 
                    AccessController.doPrivileged(J2DoPrivHelper
                            .getContextClassLoaderAction())).
                getMethod("empty_lob", new Class[0]).
                invoke(null, new Object[0]);



--
View this message in context: http://openjpa.208410.n2.nabble.com/oracle-clob-exception-tp7580960p7580961.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.