I preferred to not allow a manual rollback at all. It is probably
the case that the exception will ultimately cause a rollback. However, if
the exception is supressed for some reason, we wouldn't want the bad code
that called rollback on the connection to cause data integrity problem
with good code operating on the same connection in the same transaction.
Aaron
On Wed, 1 Aug 2001, Jung , Dr. Christoph wrote:
> shouldn�t
>
> public void rollback() throws SQLException {
> if(con == null) throw new SQLException(CLOSED);
> if(((XAResourceImpl)xaCon.getXAResource()).isTransaction())
> throw new SQLException("Cannot rollback a transactional
> connection: See JDBC 2.0 Optional Package Specification section 7.1 (p25)");
> }
>
>
> rather do
>
> public void rollback() throws SQLException {
> if(con == null) throw new SQLException(CLOSED);
> if(((XAResourceImpl)xaCon.getXAResource()).isTransaction())
> throw new SQLException("Cannot rollback a transactional
> connection: See JDBC 2.0 Optional Package Specification section 7.1 (p25)");
> try{
> con.rollback();
> } catch(SQLException e) {
> setError(e);
> throw e;
> }
> }
>
> for the sake of completeness ... ????
>
> CGJ
>
>
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development
>
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development