File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes neat way to send excpetion back to java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "neat way to send excpetion back to java" Watch "neat way to send excpetion back to java" New topic
Author

neat way to send excpetion back to java

manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
Hi all
We have certain j2ee components (jsp, servlets)
which invoke our stored procedures in Oracle databse
in our plsql code we log the exception in an error log table
. we dont raise it as we dont explicitly have commit & rollback in our stored procs.
if we raise ,the entry in the error log is rolled back
all transaction mgmt is handled by Java.
What i want to acheive is a neat way to communicate the exception bak to JAVA
Rgrds
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1132

Hi Manish,
If your version of Oracle supports it (sorry, I saw no details of your Oracle version in your post), you can use an "autonomous transaction" to insert a row into your log table. Just do a search for "autonomous transaction" at the following Web sites:
http://otn.oracle.com
http://asktom.oracle.com
http://metalink.oracle.com
http://tahiti.oracle.com
http://forums.oracle.com
Good Luck,
Avi.
[ November 20, 2003: Message edited by: Avi Abrami ]
manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
Hi Avi
Regarding Oracle version , its 817
I have tried pragma autonomous_transaction for logging errors into a error log table & then raise it bak to java
but we are using Weblogic(which is configured in such a way) that any commits, rollbacks or pragma autonomous_transaction i have on the database side , the weblogic throws an error
Rgrds
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: neat way to send excpetion back to java