hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject RE: Hivetranse: transaction demarcation
Date Sat, 03 Dec 2005 11:07:10 GMT
Alexandr,

This list doesn't support Hivetranse, as it is not part of Hivemind.  I'd
try your question on the forum set up at the the hivetranse sourceforge site
(http://sourceforge.net/forum/?group_id=123789).  Good luck!

James

-----Original Message-----
From: Alexandr Kundirenko [mailto:akundirenko@gmail.com] 
Sent: Friday, December 02, 2005 5:36 PM
To: hivemind-user@jakarta.apache.org
Subject: Hivetranse: transaction demarcation

Hello All,

I'm playing with hivetranse and trying not to open transactions for
read-only operations:

<contribution configuration-id="hivetranse.core.TransactionDefaults">
  <defaults>
    <exception name="java.lang.Throwable" rollback="true"/>
    <method pattern="load" demarcation="Supports"/>
    <method pattern="*" demarcation="Required"/>
  </defaults>
</contribution>
        
<service-point id="Session" interface="org.hibernate.Session">
  <invoke-factory service-id="hivetranse.hibernate3.SessionFactory"
model="threaded">
    <config configuration-id="HibernateSettings">
      ...
    </config>
  </invoke-factory>
</service-point>

<service-point id="Dao" interface="IDao">
  <invoke-factory model="singleton">
    <construct class="Dao">
      <set-object property="persistentClass" value="class:model.Entity" />
    </construct>
  </invoke-factory>
  <interceptor service-id="hivetranse.core.TransactionInterceptor"/>
</service-point>

But for simple test case:

public void testTransactionDemarcations() {
  IDao dao = ... obtain from registry ...;
  dao.load(ENTITY_ID);
}

I got:

net.sourceforge.hivetranse.transaction.MandatoryTransactionException: No
active transaction
at
net.sourceforge.hivetranse.transaction.hibernate3.SessionProxyFactory$Sessio
nProxy.invoke(SessionProxyFactory.java:208)
at $Proxy21.load(Unknown Source)

(The same error is for "NotSupported" and "Never" mode)

If I remove  <method pattern="load" demarcation="Supports"/> line from
transactions config - all works fine.

Does "Supports" mode work indeed?

--
Thank you, Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Mime
View raw message