On Wed, May 16, 2001 at 10:09:14AM +0200, Oscar Radio wrote:
> I'm trying to put a preparedStaement in TYPE_SCROLL_INSENSITIVE, but I
> can't, looking in the source code of the pool I find this:
> 
> In the org.jboss.pool.jdbc.xa.XAClientConnection class:
> 
>     public Statement createStatement(int resultSetType, int
> resultSetConcurrency) throws SQLException {
>         if(con == null) throw new SQLException(CLOSED);
>         try {
>             StatementInPool st = new
> StatementInPool(con.createStatement(resultSetType, resultSetConcurrency),
> this);
>             statements.add(st);
>             return st;
>         } catch(SQLException e) {
>             setError(e);
>             throw e;
>         }
>     }
> 
>     public PreparedStatement prepareStatement(String sql, int resultSetType,
> int resultSetConcurrency) throws SQLException {
>         return prepareStatement(sql);
>     }
> 
>     public PreparedStatement prepareStatement(String sql) throws
> SQLException {
>         if(con == null) throw new SQLException(CLOSED);
>         try {
>             PreparedStatement ps =
> (PreparedStatement)preparedStatementCache.useObject(sql);
>             if(ps == null)
>                 throw new SQLException("Unable to create
> PreparedStatement!");
>             PreparedStatementInPool wrapper = new
> PreparedStatementInPool(ps, this, sql);
>             statements.add(wrapper);
>             return wrapper;
>         } catch(SQLException e) {
>             setError(e);
>             throw e;
>         }
>     }
> 
> 
> 
> This means that I can't make a preparedStaement TYPE_SCROLL_INSENSITIVE, but
> I can do it with a createStatement?

It sure looks that way.  I believe that the prepared statement cache is a
little misguided in some situations.  Please log this as a bug at
SourceForge.

It is likely that the ability to disable the statement caching will be
implemented before this is fixed, so that should provide a work-around.

Toby.

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to