-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JBJCA-1244] Add ability to signal XAER_RMFAIL to the transaction man…
…ager
- Loading branch information
jesperpedersen
committed
Feb 5, 2015
1 parent
4b65831
commit da9657a
Showing
9 changed files
with
172 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...ters/src/main/java/org/jboss/jca/adapters/jdbc/extensions/mssql/MSSQLExceptionSorter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* IronJacamar, a Java EE Connector Architecture implementation | ||
* Copyright 2015, Red Hat Inc, and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.jboss.jca.adapters.jdbc.extensions.mssql; | ||
|
||
import org.jboss.jca.adapters.jdbc.spi.ExceptionSorter; | ||
|
||
import java.io.Serializable; | ||
import java.sql.SQLException; | ||
|
||
/** | ||
* A MSSQLExceptionSorter. | ||
* | ||
* @author <a href="jesper.pedersen@ironjacamar.org">Jesper Pedersen</a> | ||
*/ | ||
public class MSSQLExceptionSorter implements ExceptionSorter, Serializable | ||
{ | ||
/** The serialVersionUID */ | ||
private static final long serialVersionUID = 1L; | ||
|
||
/** | ||
* Constructor | ||
*/ | ||
public MSSQLExceptionSorter() | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public boolean isExceptionFatal(SQLException e) | ||
{ | ||
final String sqlState = e.getSQLState(); | ||
|
||
if ("08S01".equals(sqlState)) | ||
{ | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
core/src/main/java/org/jboss/jca/core/spi/transaction/local/LocalResourceException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* IronJacamar, a Java EE Connector Architecture implementation | ||
* Copyright 2015, Red Hat Inc, and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.jboss.jca.core.spi.transaction.local; | ||
|
||
import javax.resource.ResourceException; | ||
|
||
/** | ||
* LocalResourceException. | ||
* <p/> | ||
* Throwing this exception from your <code>LocalTransaction.commit()</code> or | ||
* <code>LocalTransaction.rollback()</code> methods will result in a | ||
* <code>XAException.XAER_RMFAIL</code> error code being sent to the transaction manager | ||
* | ||
* @author <a href="mailto:jesper.pedersen@ironjacamar.org">Jesper Pedersen</a> | ||
*/ | ||
public class LocalResourceException extends ResourceException | ||
{ | ||
/** Serial version UID */ | ||
private static final long serialVersionUID = 1L; | ||
|
||
/** | ||
* Creates a new instance. | ||
* @param message message | ||
*/ | ||
public LocalResourceException(String message) | ||
{ | ||
this(message, null); | ||
} | ||
|
||
/** | ||
* Creates a new instance. | ||
* @param message message | ||
* @param t cause | ||
*/ | ||
public LocalResourceException(String message, Throwable t) | ||
{ | ||
super(message, t); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters