+ /**
+ * Depending on the current application configuration, it will either commit
+ * the current transaction or throw a notification that the transaction
+ * state has changed (In the later case, it must be called from the UI
+ * thread).
+ */
+ public void commitOrNotifyTransactionStateChange() {
+ try {
+ UserTransaction userTransaction = getUserTransaction();
+ if (userTransaction.getStatus() == Status.STATUS_NO_TRANSACTION)
+ return;
+
+ if (UserAdminWrapper.COMMIT_ON_SAVE)
+ userTransaction.commit();
+ else
+ UiAdminUtils.notifyTransactionStateChange(userTransaction);
+ } catch (Exception e) {
+ throw new CmsException("Unable to clean transaction", e);
+ }
+ }
+