Open oracle cursor reaching limit after session.close()

By default, oracle 10 has the cursor counts set at 1000 if not changed by DBA. and Hibernate will not close them if you simply do session.close(). Can you believe that? !  you would think if a “session” closes, its resources should all be closed. That’s why session in hibernate can’t be regarded literally, such as a SQL*Plus session. In this case, the session behaves more like connection.

Any how, we had to insert more than 5000 rows to a single table and we got ORA error 1000, cursor reached the limit. Following this nice advice, http://javacolors.blogspot.com/2006/10/hibernate-3-and-oracle-9i-cursors-how.html

We had to change code so that we will close sessionFactory after certain amount of inserts. That way, we will ensure cursors will be closed before reaching the 1000 mark.

Another way is to set zero for the prep stmt cache, but that will be at system level to disable this nice feature.

Thanks for reading.

-Tony

Axis2 on Weblogic 9.2 and 10

Axis2 is great! Open source and easy to use. The canned samples work easily in Tomcat, hey they are from the same family, aren’t they!
When I used the same thing to Weblogic (Oracle now) 10.3. I got problems when ruuning Client to the WS (Axis2UserGuide Example). It gave me  NULL Pointers when client tried to parse the response from WS. I googled a lot and found very vague answers.

Then I went back to Apache site and read carefully, walla, it is right there at this link http://ws.apache.org/axis2/1_2/app_server.html

Basically, I had to make an ear instead of war file. And put weblogic-application.xml like this in the Meta-inf folder.

<?xml version=”1.0″ encoding=”UTF-8″?>
<weblogic-application xmlns=”http://www.bea.com/ns/weblogic/90″&gt;
<prefer-application-packages>
<package-name>com.ctc.wstx.*</package-name>
<package-name>javax.xml.*</package-name>
<package-name>org.apache.*</package-name>
</prefer-application-packages>
</weblogic-application>

Also, add Weblogic.xml in the WEB-INF folder the following:

<?xml version=”1.0″?>

<weblogic-web-app xmlns=”http://www.bea.com/ns/weblogic/90&#8243; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”&gt;

<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>

</weblogic-web-app>

Client.java ran great after these additions/mods. All these changes basically ensures weblogic’s classes don’t contaminate classes from Axis2.

so the moral of this story is – After all failed, read the manual. (sorry for the cliche)

-T