Author: mputz
Date: 2015-01-09 06:37:46 -0500 (Fri, 09 Jan 2015)
New Revision: 9333
Modified:
epp/portal/branches/EPP_5_2_2_GA_BZ1180232/component/identity/src/main/java/org/exoplatform/services/organization/idm/AbstractDAOImpl.java
epp/portal/branches/EPP_5_2_2_GA_BZ1180232/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
Log:
Backport fixes related to GTNPORTAL-3243
Modified:
epp/portal/branches/EPP_5_2_2_GA_BZ1180232/component/identity/src/main/java/org/exoplatform/services/organization/idm/AbstractDAOImpl.java
===================================================================
---
epp/portal/branches/EPP_5_2_2_GA_BZ1180232/component/identity/src/main/java/org/exoplatform/services/organization/idm/AbstractDAOImpl.java 2015-01-09
10:52:38 UTC (rev 9332)
+++
epp/portal/branches/EPP_5_2_2_GA_BZ1180232/component/identity/src/main/java/org/exoplatform/services/organization/idm/AbstractDAOImpl.java 2015-01-09
11:37:46 UTC (rev 9333)
@@ -69,7 +69,7 @@
log.warn("Unable to set Transaction status to be rollback only",
tre);
}
} else {
- orgService.recoverFromIDMError();
+ orgService.recoverFromIDMError(e);
}
}
Modified:
epp/portal/branches/EPP_5_2_2_GA_BZ1180232/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
===================================================================
---
epp/portal/branches/EPP_5_2_2_GA_BZ1180232/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2015-01-09
10:52:38 UTC (rev 9332)
+++
epp/portal/branches/EPP_5_2_2_GA_BZ1180232/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2015-01-09
11:37:46 UTC (rev 9333)
@@ -174,83 +174,60 @@
}
- public void flush()
- {
- try
- {
-
-
- if (configuration.isUseJTA())
- {
- if (traceLoggingEnabled)
- {
- log.trace("Flushing UserTransaction in method flush");
+ public void flush() {
+ if (configuration.isUseJTA()) {
+ if (traceLoggingEnabled) {
+ log.trace("Flushing UserTransaction in method flush");
}
- // Complete restart of JTA transaction don't have good performance. So we
will only sync identitySession (same as for non-jta environment)
+ // Complete restart of JTA transaction don't have good performance. So we
will only sync identitySession (same
+ // as for non-jta environment)
// finishJTATransaction();
// beginJTATransaction();
- if (getUserTransaction().getStatus() == Status.STATUS_ACTIVE)
- {
- idmService_.getIdentitySession().save();
+ try {
+ if (getUserTransaction().getStatus() == Status.STATUS_ACTIVE) {
+ idmService_.getIdentitySession().save();
+ }
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
}
- }
- else
- {
- if (idmService_.getIdentitySession().getTransaction().isActive())
- {
- try {
- if (idmService_.getIdentitySession().getTransaction().isActive()) {
- idmService_.getIdentitySession().save();
- }
- } catch (Exception e) {
- log.error(e.getMessage(), e);
- recoverFromIDMError();
- }
+ } else {
+ try {
+ if (idmService_.getIdentitySession().getTransaction().isActive()) {
+ idmService_.getIdentitySession().save();
+ }
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ recoverFromIDMError(e);
}
- }
+ }
+ }
- }
- catch (Exception e)
- {
- log.error(e.getMessage(), e);
- }
- }
-
-
- public void endRequest(ExoContainer container)
- {
- try
- {
- if (configuration.isUseJTA())
- {
- if (traceLoggingEnabled)
- {
- log.trace("Finishing UserTransaction in method endRequest");
+ public void endRequest(ExoContainer container) {
+ if (configuration.isUseJTA()) {
+ if (traceLoggingEnabled) {
+ log.trace("Finishing UserTransaction in method endRequest");
}
- finishJTATransaction();
- }
- else
- {
try {
- if (idmService_.getIdentitySession().getTransaction().isActive()) {
- idmService_.getIdentitySession().getTransaction().commit();
- }
+ finishJTATransaction();
} catch (Exception e) {
- log.error(e.getMessage(), e);
- recoverFromIDMError();
+ log.error(e.getMessage(), e);
}
- }
- }
- catch (Exception e)
- {
- log.error(e.getMessage(), e);
- }
- }
+ } else {
+ try {
+ if (idmService_.getIdentitySession().getTransaction().isActive()) {
+ idmService_.getIdentitySession().getTransaction().commit();
+ }
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ recoverFromIDMError(e);
+ }
+ }
+ }
// Should be used only for non-JTA environment
- public void recoverFromIDMError() {
+ public void recoverFromIDMError(Exception e) {
try {
// We need to restart Hibernate transaction if it's available. First
rollback old one and then start new one
Transaction idmTransaction =
idmService_.getIdentitySession().getTransaction();
Show replies by date