protected void throwAtomikosSQLException ( String msg ) throws AtomikosSQLException { throwAtomikosSQLException ( msg , null ); }
public Connection getConnection() throws SQLException { if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( this + ": getConnection()..." ); Connection connection = null; init(); try { connection = (Connection) connectionPool.borrowConnection(); } catch (CreateConnectionException ex) { throwAtomikosSQLException("Failed to grow the connection pool", ex); } catch (PoolExhaustedException e) { throwAtomikosSQLException ("Connection pool exhausted - try increasing 'maxPoolSize' and/or 'borrowConnectionTimeout' on the DataSourceBean."); } catch (ConnectionPoolException e) { throwAtomikosSQLException("Error borrowing connection", e ); } if ( LOGGER.isTraceEnabled() ) LOGGER.logTrace ( this + ": returning " + connection ); return connection; }
return; if ( maxPoolSize < 1 ) throwAtomikosSQLException ( "Property 'maxPoolSize' must be greater than 0, was: " + maxPoolSize ); if ( minPoolSize < 0 || minPoolSize > maxPoolSize ) throwAtomikosSQLException("Property 'minPoolSize' must be at least 0 and at most maxPoolSize, was: " + minPoolSize); if ( getUniqueResourceName() == null ) throwAtomikosSQLException("Property 'uniqueResourceName' cannot be null"); if ( getMinPoolSize() == DEFAULT_POOL_SIZE ) { LOGGER.logWarning ( this + ": poolSize equals default - this may cause performance problems!" );