If you run recursive sql in the oracle db 11.1.x, you probably meet issue like this:
Internal Exception: java.sql.SQLException: Closed Connection, it is a bug in this DB version.
you have 2 options to fix the issue:
1. login sqlplus as sys admin , run the command :
alter system set "_optimizer_connect_by_cost_based" =FALSE;
2. upgrade the db to 11.2.x.