Bug 835578 - Open an "Identity Transaction" only when it is necessary
Open an "Identity Transaction" only when it is necessary
Status: VERIFIED
Product: JBoss Enterprise Portal Platform 5
Classification: JBoss
Component: PicketLink, Portal (Show other bugs)
5.2.1.ER02
Unspecified Unspecified
unspecified Severity medium
: ---
: 5.2.2.ER01
Assigned To: mposolda
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-26 10:16 EDT by mposolda
Modified: 2013-04-30 19:37 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Hibernate transactions had to be started for each HTTP request from an anonymous or authenticated user, which in turn required a new database connection from the connection pool (an expensive operation if it is not required for the request). The fix enables a new option, "lazyStartOfHibernateTransaction", which is set in gatein.ear/02portal.war/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-config.xml. </para> <programlisting> &lt;option&gt; &lt;name&gt;lazyStartOfHibernateTransaction&lt;/name&gt; &lt;value&gt;false&lt;/value&gt; &lt;/option&gt; </programlisting> <para>If the value is set to true, the Hibernate transaction is started only when required, and not for every request. The default value is false for backwards-compatibility.
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Enhancement
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Commits:
8746 by mposolda at 2012-06-26 10:22:40 EDT (show)
8746 by mposolda at 2012-06-26 10:22:40 EDT

Checked in to /mnt/n4aphx2-3.storage.phx2.redhat.com/svn/repos/gatein

Bug 835578 New option 'lazyStartOfHibernateTransaction' added to Picketlink IDM configuration for support of lazy hibernate transaction. Default value is false, so it will still use old behaviour.

7 files changed:

  • epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/examples/picketlink-idm-ldap-acme-config.xml (+4 / -0)
  • epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/examples/picketlink-idm-ldap-config.xml (+4 / -0)
  • epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/examples/picketlink-idm-msad-config.xml (+4 / -0)
  • epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/examples/picketlink-idm-msad-readonly-config.xml (+4 / -0)
  • epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/examples/picketlink-idm-openldap-acme-config.xml (+4 / -0)
  • epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/examples/picketlink-idm-openldap-config.xml (+4 / -0)
  • epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-config.xml (+4 / -0)


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker GTNPORTAL-2463 Major Resolved Open an "Identity Transaction" only when it is necessary 2017-08-24 04:21 EDT
JBoss Issue Tracker PLIDM-32 Major Resolved Support non-JTA client-managed TX mode with lazy tx.begin() 2017-08-24 04:21 EDT

  None (edit)
Description mposolda 2012-06-26 10:16:12 EDT
The component PicketLinkIDMOrganizationServiceImpl has been defined as a ComponentRequestLifecycle to be able to scope an "identity transaction" to the life time of the request. However depending on the page we try to access, it could be useless to open a tx in case the organization service is not even accessed which can have a dramatic impact on performances for nothing especially when we use hibernate because when we open a tx with hibernate, it does a JDBC call to switch to non auto commit mode.
Comment 1 mposolda 2012-06-26 10:34:05 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
CAUSE: Currently hibernate transaction needs to be started for every HTTP request of anonymous or logged user to EPP. This always needs obtain new DB connection from connection pool, which is quite expensive operation.

FIX: There is fix available in underlying component Picketlink IDM, which added possibility to start Hibernate transaction lazily only for case when it's really needed. It's adding new option "lazyStartOfHibernateTransaction" into Picketlink IDM configuration file. Value true means that Hibernate transaction will be started lazily only when needed. Value false is starting transaction non-lazily during each request (current behaviour)

RESULT: In configuration file gatein.ear/02portal.war/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-config.xml is new option added:
          <option>
            <name>lazyStartOfHibernateTransaction</name>
            <value>false</value>
          </option>

We can see that default value is false, so behaviour is same like before (because of backward compatibility and avoiding of risk).

But for customers, who have problem with performance and DB connection is critical for them, it would be good to switch this option to "true".
Comment 2 Michal Vanco 2012-07-17 08:04:13 EDT
Verified with few performance tests with updated lazyStartOfHibernateTransaction (set to true), minimum number of idm connections are present during the tests.
Comment 3 Jared MORGAN 2012-08-19 21:44:41 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -2,12 +2,12 @@
 
 FIX: There is fix available in underlying component Picketlink IDM, which added possibility to start Hibernate transaction lazily only for case when it's really needed. It's adding new option "lazyStartOfHibernateTransaction" into Picketlink IDM configuration file. Value true means that Hibernate transaction will be started lazily only when needed. Value false is starting transaction non-lazily during each request (current behaviour)
 
-RESULT: In configuration file gatein.ear/02portal.war/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-config.xml is new option added:
-          <option>
+RESULT: In configuration file gatein.ear/02portal.war/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-config.xml is new option added:</para>
+          <programlisting>[CDATA[<option>
             <name>lazyStartOfHibernateTransaction</name>
             <value>false</value>
-          </option>
+          </option>]]</programlisting
 
-We can see that default value is false, so behaviour is same like before (because of backward compatibility and avoiding of risk).
+<para>We can see that default value is false, so behaviour is same like before (because of backward compatibility and avoiding of risk).
 
 But for customers, who have problem with performance and DB connection is critical for them, it would be good to switch this option to "true".
Comment 4 Jared MORGAN 2012-08-19 21:51:08 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -3,10 +3,10 @@
 FIX: There is fix available in underlying component Picketlink IDM, which added possibility to start Hibernate transaction lazily only for case when it's really needed. It's adding new option "lazyStartOfHibernateTransaction" into Picketlink IDM configuration file. Value true means that Hibernate transaction will be started lazily only when needed. Value false is starting transaction non-lazily during each request (current behaviour)
 
 RESULT: In configuration file gatein.ear/02portal.war/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-config.xml is new option added:</para>
-          <programlisting>[CDATA[<option>
+          <programlisting>&[CDATA[<option>
             <name>lazyStartOfHibernateTransaction</name>
             <value>false</value>
-          </option>]]</programlisting
+          </option>]];</programlisting
 
 <para>We can see that default value is false, so behaviour is same like before (because of backward compatibility and avoiding of risk).
Comment 5 Jared MORGAN 2012-08-19 22:04:16 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -3,10 +3,10 @@
 FIX: There is fix available in underlying component Picketlink IDM, which added possibility to start Hibernate transaction lazily only for case when it's really needed. It's adding new option "lazyStartOfHibernateTransaction" into Picketlink IDM configuration file. Value true means that Hibernate transaction will be started lazily only when needed. Value false is starting transaction non-lazily during each request (current behaviour)
 
 RESULT: In configuration file gatein.ear/02portal.war/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-config.xml is new option added:</para>
-          <programlisting>&[CDATA[<option>
+          <programlisting><![CDATA[<option>
             <name>lazyStartOfHibernateTransaction</name>
             <value>false</value>
-          </option>]];</programlisting
+          </option>]]></programlisting
 
 <para>We can see that default value is false, so behaviour is same like before (because of backward compatibility and avoiding of risk).
Comment 6 Jared MORGAN 2012-08-20 00:17:51 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -3,10 +3,10 @@
 FIX: There is fix available in underlying component Picketlink IDM, which added possibility to start Hibernate transaction lazily only for case when it's really needed. It's adding new option "lazyStartOfHibernateTransaction" into Picketlink IDM configuration file. Value true means that Hibernate transaction will be started lazily only when needed. Value false is starting transaction non-lazily during each request (current behaviour)
 
 RESULT: In configuration file gatein.ear/02portal.war/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-config.xml is new option added:</para>
-          <programlisting><![CDATA[<option>
+          <programlisting><option>
             <name>lazyStartOfHibernateTransaction</name>
             <value>false</value>
-          </option>]]></programlisting
+          </option></programlisting>
 
 <para>We can see that default value is false, so behaviour is same like before (because of backward compatibility and avoiding of risk).
Comment 7 Jared MORGAN 2012-08-21 00:46:18 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,13 +1,9 @@
-CAUSE: Currently hibernate transaction needs to be started for every HTTP request of anonymous or logged user to EPP. This always needs obtain new DB connection from connection pool, which is quite expensive operation.
+Hibernate transactions had to be started for each HTTP request from an anonymous or authenticated user, which in turn required a new database connection from the connection pool (an expensive operation if it is not required for the request). The fix enables a new option, "lazyStartOfHibernateTransaction", which is set in gatein.ear/02portal.war/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-config.xml. 
-
+</para>
-FIX: There is fix available in underlying component Picketlink IDM, which added possibility to start Hibernate transaction lazily only for case when it's really needed. It's adding new option "lazyStartOfHibernateTransaction" into Picketlink IDM configuration file. Value true means that Hibernate transaction will be started lazily only when needed. Value false is starting transaction non-lazily during each request (current behaviour)
+<programlisting>
-
+  <option>
-RESULT: In configuration file gatein.ear/02portal.war/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-config.xml is new option added:</para>
+    <name>lazyStartOfHibernateTransaction</name>
-          <programlisting><option>
+    <value>false</value>
-            <name>lazyStartOfHibernateTransaction</name>
+  </option>
-            <value>false</value>
+</programlisting>
-          </option></programlisting>
+<para>If the value is set to true, the Hibernate transaction is started only when required, and not for every request. The default value is false for backwards-compatibility.-
-<para>We can see that default value is false, so behaviour is same like before (because of backward compatibility and avoiding of risk).
-
-But for customers, who have problem with performance and DB connection is critical for them, it would be good to switch this option to "true".
Comment 8 Jared MORGAN 2012-08-21 02:22:04 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,9 +1,9 @@
 Hibernate transactions had to be started for each HTTP request from an anonymous or authenticated user, which in turn required a new database connection from the connection pool (an expensive operation if it is not required for the request). The fix enables a new option, "lazyStartOfHibernateTransaction", which is set in gatein.ear/02portal.war/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-config.xml. 
 </para>
 <programlisting>
-  <option>
-    <name>lazyStartOfHibernateTransaction</name>
-    <value>false</value>
-  </option>
+&lt;option&gt;
+    &lt;name&gt;lazyStartOfHibernateTransaction&lt;/name&gt;
+    &lt;value&gt;false&lt;/value&gt;
+  &lt;/option&gt;
 </programlisting>
 <para>If the value is set to true, the Hibernate transaction is started only when required, and not for every request. The default value is false for backwards-compatibility.

Note You need to log in before you can comment on or make changes to this bug.