You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Lise Frengen <Li...@bokklubbene.no> on 2002/06/03 14:21:13 UTC

Problem with GenericDataSource


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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>