You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by gp...@apache.org on 2012/08/05 17:01:14 UTC

git commit: DELTASPIKE-250 added hints

Updated Branches:
  refs/heads/master 9b98b1dc4 -> 8716d951b


DELTASPIKE-250 added hints


Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/8716d951
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/8716d951
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/8716d951

Branch: refs/heads/master
Commit: 8716d951b85499eb0f69c80a8d15b20d3434d76f
Parents: 9b98b1d
Author: gpetracek <gp...@apache.org>
Authored: Sun Aug 5 16:54:31 2012 +0200
Committer: gpetracek <gp...@apache.org>
Committed: Sun Aug 5 16:54:31 2012 +0200

----------------------------------------------------------------------
 .../EnvironmentAwareTransactionStrategy.java       |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/8716d951/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/EnvironmentAwareTransactionStrategy.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/EnvironmentAwareTransactionStrategy.java b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/EnvironmentAwareTransactionStrategy.java
index 278ce78..0ef7f9f 100644
--- a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/EnvironmentAwareTransactionStrategy.java
+++ b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/EnvironmentAwareTransactionStrategy.java
@@ -32,7 +32,12 @@ import java.lang.annotation.Annotation;
  * if different environments (dev., prod.,...) should use different transaction-types.</p>
  *
  * <p>This implementation can be used for environments which allow a mixed usage of JTA and RESOURCE_LOCAL.
- * (Within a transactional call it isn't possible to mix different transaction-types.)</p>
+ * (Within a transactional call it isn't possible to mix different transaction-types.)<b/>
+ *
+ * E.g.: in an application-server this class allows to use a persistence-unit with
+ * transaction-type="RESOURCE_LOCAL" + non-jta-data-source
+ * in parallel to a persistence-unit with
+ * transaction-type="JTA" + jta-data-source</p>
  *
  * <p>Optional:<br/>
  * E.g. in case of a project-stage based logic
@@ -49,6 +54,11 @@ import java.lang.annotation.Annotation;
 @Dependent
 @Alternative
 @SuppressWarnings("UnusedDeclaration")
+//TODO depending on further discussions about an own JTA module, BeanManagedUserTransactionStrategy
+//could be the default (via @Specializes) in the ds-jta module.
+//Depending on further discussions this class can be merged with BeanManagedUserTransactionStrategy or
+//we keep BeanManagedUserTransactionStrategy separated as a small tweak for applications which only use JTA transactions
+//or as a base implementation for a custom EnvironmentAwareTransactionStrategy.
 public class EnvironmentAwareTransactionStrategy extends BeanManagedUserTransactionStrategy
 {
     private static final long serialVersionUID = -4432802805095533499L;
@@ -88,9 +98,6 @@ public class EnvironmentAwareTransactionStrategy extends BeanManagedUserTransact
         return new EntityManagerEntry(entityManager, qualifier);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     protected void beforeProceed(EntityManagerEntry entityManagerEntry)
     {