Java Stored Procedure and Google Analytics

14 views
Skip to first unread message

Kevin Vermaat

unread,
Sep 4, 2011, 6:02:42 AM9/4/11
to gdata-java-client
I'm trying to make a Java Stored Procedure in Oracle 11g which
retrieve Google Analytics information.

Working on this for three days now, but without success. Here is step
by step what I did:

Uploaded the 5 required JAR files, [here link][1], to the database
using:

`loadjava -user scott/tiger@WH01 gdata-analytics-2.1.jar`

Then i created java source file (in pl/sql developer IDE) and used the
example code in the link above. Compiled it (f8) and it appeared in
the Java Classes Tree (same for the classes created with the jar
files).

After I wrote the procedure to call the java class:

`create or replace procedure KEVIN_PROCEDURE_ANALYTICS
AS LANGUAGE JAVA
NAME 'Kevin_Analytics.main(java.lang.String[])';`

Finally I call the procedure:

`exec KEVIN_PROCEDURE_ANALYTICS();`

and i get the error:

`ORA-29532: Java call terminated by uncaught Java exception:
java.lang.IllegalStateException: Cannot call dirty() without holding
the lock on the registry.`

Using google I found [this link][2] (the java code of a class where
there is a method which prints this error message exactly) and I
figured that I had to use an synchronized method, please check the
link and I think you will find out too.

Now the problem is, I have really no idea how and where I must put
this synchronized code. If someone of you can show me this I will be
really, really happy. I used the example code on the first link.


Thanks for reading this post, please, if someone can help me, it will
be greatly appreciated.


Kevin Vermaat


[1]: http://code.google.com/intl/nl-NL/apis/analytics/docs/gdata/2.0/gdataJava.html
[2]: http://gdata-java-client.googlecode.com/svn-history/r87/trunk/java/src/com/google/gdata/model/MetadataRegistryBuilder.java
Reply all
Reply to author
Forward
0 new messages