Tabnine Logo
SynchronizationTypeAccess.getSynchronizationType
Code IndexAdd Tabnine to your IDE (free)

How to use
getSynchronizationType
method
in
org.jboss.as.jpa.container.SynchronizationTypeAccess

Best Java code snippets using org.jboss.as.jpa.container.SynchronizationTypeAccess.getSynchronizationType (Showing top 2 results out of 315)

origin: org.wildfly/wildfly-jpa

  /**
   * throw error if jta transaction already has an UNSYNCHRONIZED persistence context and a SYNCHRONIZED persistence context
   * is requested.  We are only fussy in this test, if the target component persistence context is SYNCHRONIZED.
   *
   * WFLY-7075 introduces two extensions, allow a (transaction) joined UNSYNCHRONIZED persistence context to be treated as SYNCHRONIZED,
   * allow the checking for mixed SynchronizationType to be skipped.
   */
  private static void testForMixedSynchronizationTypes(EntityManagerFactory emf, EntityManager entityManagerFromJTA, String scopedPuName, final SynchronizationType targetSynchronizationType, Map targetProperties) {

    boolean skipMixedSyncTypeChecking = Configuration.skipMixedSynchronizationTypeCheck(emf, targetProperties);  // extension to allow skipping of check based on properties of target entity manager
    boolean allowJoinedUnsyncPersistenceContext = Configuration.allowJoinedUnsyncPersistenceContext(emf, targetProperties); // extension to allow joined unsync persistence context to be treated as sync persistence context

    if (!skipMixedSyncTypeChecking &&
        SynchronizationType.SYNCHRONIZED.equals(targetSynchronizationType) &&
        entityManagerFromJTA instanceof SynchronizationTypeAccess &&
        SynchronizationType.UNSYNCHRONIZED.equals(((SynchronizationTypeAccess) entityManagerFromJTA).getSynchronizationType())
        && (!allowJoinedUnsyncPersistenceContext || !entityManagerFromJTA.isJoinedToTransaction())) {
      throw JpaLogger.ROOT_LOGGER.badSynchronizationTypeCombination(scopedPuName);
    }
  }
}
origin: org.jboss.eap/wildfly-jpa

  /**
   * throw error if jta transaction already has an UNSYNCHRONIZED persistence context and a SYNCHRONIZED persistence context
   * is requested.  We are only fussy in this test, if the target component persistence context is SYNCHRONIZED.
   *
   * WFLY-7075 introduces two extensions, allow a (transaction) joined UNSYNCHRONIZED persistence context to be treated as SYNCHRONIZED,
   * allow the checking for mixed SynchronizationType to be skipped.
   */
  private static void testForMixedSynchronizationTypes(EntityManagerFactory emf, EntityManager entityManagerFromJTA, String scopedPuName, final SynchronizationType targetSynchronizationType, Map targetProperties) {

    boolean skipMixedSyncTypeChecking = Configuration.skipMixedSynchronizationTypeCheck(emf, targetProperties);  // extension to allow skipping of check based on properties of target entity manager
    boolean allowJoinedUnsyncPersistenceContext = Configuration.allowJoinedUnsyncPersistenceContext(emf, targetProperties); // extension to allow joined unsync persistence context to be treated as sync persistence context

    if (!skipMixedSyncTypeChecking &&
        SynchronizationType.SYNCHRONIZED.equals(targetSynchronizationType) &&
        entityManagerFromJTA instanceof SynchronizationTypeAccess &&
        SynchronizationType.UNSYNCHRONIZED.equals(((SynchronizationTypeAccess) entityManagerFromJTA).getSynchronizationType())
        && (!allowJoinedUnsyncPersistenceContext || !entityManagerFromJTA.isJoinedToTransaction())) {
      throw JpaLogger.ROOT_LOGGER.badSynchronizationTypeCombination(scopedPuName);
    }
  }
}
org.jboss.as.jpa.containerSynchronizationTypeAccessgetSynchronizationType

Popular methods of SynchronizationTypeAccess

    Popular in Java

    • Start an intent from android
    • setRequestProperty (URLConnection)
    • putExtra (Intent)
    • onCreateOptionsMenu (Activity)
    • Window (java.awt)
      A Window object is a top-level window with no borders and no menubar. The default layout for a windo
    • RandomAccessFile (java.io)
      Allows reading from and writing to a file in a random-access manner. This is different from the uni-
    • NumberFormat (java.text)
      The abstract base class for all number formats. This class provides the interface for formatting and
    • DataSource (javax.sql)
      An interface for the creation of Connection objects which represent a connection to a database. This
    • XPath (javax.xml.xpath)
      XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
    • Loader (org.hibernate.loader)
      Abstract superclass of object loading (and querying) strategies. This class implements useful common
    • Top Sublime Text plugins
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now