aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/DBAuthenticationSessionStoreage.java
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/DBAuthenticationSessionStoreage.java')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/DBAuthenticationSessionStoreage.java29
1 files changed, 15 insertions, 14 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/DBAuthenticationSessionStoreage.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/DBAuthenticationSessionStoreage.java
index 43b4ecf17..094e25040 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/DBAuthenticationSessionStoreage.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/DBAuthenticationSessionStoreage.java
@@ -32,6 +32,7 @@ import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.hibernate.resource.transaction.spi.TransactionStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -231,7 +232,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
}
} catch (Exception e) {
- if (tx != null && !tx.wasCommitted())
+ if (tx != null && !tx.getStatus().equals(TransactionStatus.COMMITTED))
tx.rollback();
throw e;
@@ -321,7 +322,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
}
} catch (Exception e) {
- if (tx != null && !tx.wasCommitted())
+ if (tx != null && !tx.getStatus().equals(TransactionStatus.COMMITTED))
tx.rollback();
throw e;
}
@@ -371,7 +372,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
return result.get(0);
}
} catch (Exception e) {
- if (tx != null && !tx.wasCommitted())
+ if (tx != null && !tx.getStatus().equals(TransactionStatus.COMMITTED))
tx.rollback();
throw e;
}
@@ -477,7 +478,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
} catch(HibernateException e) {
Logger.warn("Error during database saveOrUpdate. Rollback.", e);
- if (tx != null && !tx.wasCommitted())
+ if (tx != null && !tx.getStatus().equals(TransactionStatus.COMMITTED))
tx.rollback();
throw new AuthenticationException("SSO Session information can not be stored! --> SSO is deactivated", null);
}
@@ -504,7 +505,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
} catch (Exception e) {
if (session != null && session.getTransaction() != null
- && !session.getTransaction().wasCommitted()) {
+ && !session.getTransaction().getStatus().equals(TransactionStatus.COMMITTED)) {
session.getTransaction().rollback();
throw e;
@@ -534,7 +535,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
} catch (Exception e) {
if (session != null && session.getTransaction() != null
- && !session.getTransaction().wasCommitted()) {
+ && !session.getTransaction().getStatus().equals(TransactionStatus.COMMITTED)) {
session.getTransaction().rollback();
throw e;
@@ -583,7 +584,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
return null;
} catch (Exception e) {
- if (tx != null && !tx.wasCommitted())
+ if (tx != null && !tx.getStatus().equals(TransactionStatus.COMMITTED))
tx.rollback();
throw e;
}
@@ -626,7 +627,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
return result.get(0).getActiveOAsessions().get(0);
} catch (Exception e) {
- if (tx != null && !tx.wasCommitted())
+ if (tx != null && !tx.getStatus().equals(TransactionStatus.COMMITTED))
tx.rollback();
throw e;
}
@@ -665,7 +666,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
} catch (Throwable e) {
Logger.warn("MOASession deserialization-exception by using MOASessionID=" + nameID);
- if (tx != null && !tx.wasCommitted())
+ if (tx != null && !tx.getStatus().equals(TransactionStatus.COMMITTED))
tx.rollback();
return null;
}
@@ -702,7 +703,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
return result.get(0).getInderfederation().get(0);
} catch (Exception e) {
- if (tx != null && !tx.wasCommitted())
+ if (tx != null && !tx.getStatus().equals(TransactionStatus.COMMITTED))
tx.rollback();
throw e;
}
@@ -740,7 +741,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
return result.get(0).getInderfederation().get(0);
} catch (Exception e) {
- if (tx != null && !tx.wasCommitted())
+ if (tx != null && !tx.getStatus().equals(TransactionStatus.COMMITTED))
tx.rollback();
throw e;
}
@@ -856,7 +857,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
return result.get(0).getInderfederation().get(0);
} catch (Exception e) {
- if (tx != null && !tx.wasCommitted())
+ if (tx != null && !tx.getStatus().equals(TransactionStatus.COMMITTED))
tx.rollback();
throw e;
}
@@ -948,7 +949,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
}
} catch (Exception e) {
- if (tx != null && !tx.wasCommitted())
+ if (tx != null && !tx.getStatus().equals(TransactionStatus.COMMITTED))
tx.rollback();
throw e;
}
@@ -1018,7 +1019,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
return (AuthenticatedSessionStore) result.get(0);
} catch (Exception e) {
- if (tx != null && !tx.wasCommitted() && commit)
+ if (tx != null && !tx.getStatus().equals(TransactionStatus.COMMITTED) && commit)
tx.rollback();
throw e;
}