Andreas,

Here's some of my config. for a Tapestry + Hivemind + Hibernate combination. As I said previously, it is all standard and based on the quick start guide on the HiveUtils site.

<!-- Hibernate configuration via HiveUtils -->
 <implementation service-id="hivetranse.hibernate3.SessionFactoryBuilder">
   <invoke-factory model="primitive">
<construct class="net.sourceforge.hivetranse.transaction.hibernate3.SessionFactoryBuilderImpl">
       <log/>
     </construct>
   </invoke-factory>
 </implementation>


<!-- My hivemodule.xml ends up in WEB-INF/classes/META-INF/ and my hibernate.cfg.xml file is in WEB-INF/classes, so I tell the SessionFactoryBuilder service below to look up a level in the directory structure for the Hibernate config. -->

 <service-point id="session" interface="org.hibernate.Session">
<invoke-factory service-id="hivetranse.hibernate3.SessionFactory" model="singleton">
     <config file="../hibernate.cfg.xml" />
   </invoke-factory>
 </service-point>

 <contribution configuration-id="hivetranse.core.TransactionDefaults">
   <defaults>
     <exception name="java.lang.Throwable" rollback="true"/>
     <method pattern="*" demarcation="Never"/>
   </defaults>
 </contribution>

 <contribution configuration-id="hivemind.ApplicationDefaults">
   <default symbol="hivetranse.hibernate3.DeferSessionClose" value="true"/>
 </contribution>

The above relies on Hibernate 3.1.2. Apparently it only requires 3.1.1 to work but the important thing to note is that 3.x wont.

Here's also an example service, which is injected with the session:

<service-point id="fooManager" interface="com.q9software.FooManager">
   <invoke-factory>
     <construct class="com.q9software.DefaultFooManager">
       <set-object property="session" value="service:portal.session"/>
     </construct>
   </invoke-factory>
   <interceptor service-id="hivetranse.core.TransactionInterceptor">
     <method pattern="*" demarcation="Required"/>
     <exception name="java.lang.RuntimeException" rollback="true"/>
     <exception name="java.lang.Exception" rollback="false"/>
   </interceptor>
 </service-point>


My DefaultFooManager has a getter and setter for the session object:


 public Session getSession() {
   return session;
 }

 public void setSession(Session session) {
   this.session = session;
 }

Make sure that you do not have hivetranse.hibernate.jar on your classpath. You must use hivetranse.hibernate3.jar .

All the best,
Nick


Andreas Bulling wrote:
On 22. Feb 2006 - 12:01:06, James Carman wrote:
| No problem.  I've actually enjoyed HiveMind-izing my stuff.  Since I am a
| committer on the HiveMind project, I really should "eat my own dog food."
| :-)

Well, I would like to be able to say that from my experience...
Hivetranse/Hibernate still don't work for me :(
I'm thinking about switching back to Spring where I was at least
able to see something happen in my database...

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to