I am using Struts 1.0.2 and I have a problem with the GenericDataSource object: 
   when I try to close the source, everything hangs. 

What am I doing wrong?

     try{
            GenericDataSource dataSource = new GenericDataSource();
            dataSource.setAutoCommit(false);
            dataSource.setDriverClass("oracle.jdbc.driver.OracleDriver");
            dataSource.setPassword(password);
            dataSource.setUrl(url);
            dataSource.setUser(user);
        .
            dataSource.open();

            Connection  conn = dataSource.getConnection();
            .
        .
        conn.commit();
            if (conn != null) {
                try {
                    conn.close();
                } catch (SQLException f) {}
                conn = null;
            }

            if (dataSource!= null){
                    dataSource.close();  // here everything hangs...
                    dataSource = null;                
            }
        }catch (Exception e){
            e.printStackTrace();
        }

Any good ideas?

After a while (not beeing able to close the source) I get the following exception:

"java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-04031: unable to allocate 4128 bytes of shared memory ("shared 
pool","DATABASE","sga heap","multiblock rea")"

is this due to the fact that the source did no get closed properly?
 And why is GenericDataSource deprecated in later versions?


Lise M.B. Frengen


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to