Added to the wiki
(http://wiki.apache.org/jakarta-hivemind/HibernateSupport).

Any pointers/ideas would be gratefully accepted.

Yuxiang, could you add your technique on there too so that others can
discuss it on there. I think we should be able to use bits from both
approaches to get some powerful Hibernate integration going.

Thanks,
Jim

-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] 
Sent: 15 September 2004 14:05
To: [email protected]
Subject: [jira] Commented: (HIVEMIND-54) Request for built-in support for
Hibernate in HiveMind lib

The following comment has been added to this issue:

     Author: Howard M. Lewis Ship
    Created: Wed, 15 Sep 2004 6:04 AM
       Body:
Might be easier to discuss this as a Change Proposal on the Wiki.

I just fixed a bug (HIVEMIND-55) related to JDK proxies (that problem you
observed), so you should be able to order your interceptors appropriately.
The change is in CVS HEAD and will be in the 1.0 final release.
---------------------------------------------------------------------
View this comment:
 
http://issues.apache.org/jira/browse/HIVEMIND-54?page=comments#action_53108

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/HIVEMIND-54

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: HIVEMIND-54
    Summary: Request for built-in support for Hibernate in HiveMind lib
       Type: New Feature

     Status: Open
   Priority: Major

    Project: HiveMind
 Components: 
             documentation
             examples
             hivebuild

   Assignee: Howard M. Lewis Ship
   Reporter: Yuxiang Bu

    Created: Mon, 13 Sep 2004 2:24 AM
    Updated: Wed, 15 Sep 2004 6:04 AM

Description:
Request for adding build-in support for Hibernate Session and Transaction
management in HiveMind lib.

Since Hibernate is so popular now, I believe it will become a hot request.

At first I try to develop an HibernateInterceptorFactory service using
javassist.
But I found javassist cannot support "finally" yet. And the target code like
this: 

    boolean isTransactionBegunInThisMethod = false;
    try {
        isTransactionBegunInThisMethod = tm.beginTransaction();
        Object result = _inner....
        if (isTransactionBegunInThisMethod)
            tm.commitTransaction();
        return result;
    } finally {
        if (isTransactionBegunInThisMethod)
            tm.rollbackTransaction();
    }

And I cannot develop similar codes in javassist.
Then I developed an Interceptor with JDK proxy.

However, the interceptor cannot be used after HiveMind LoggingInterceptor.
The Registry successfully applies my HibernateInterceptor to service but
fail to apply the Logging Interceptor.

org.apache.hivemind.ApplicationRuntimeException: Unable to construct service
doconline.Adder: Unable to lookup $Proxy0: $Proxy0
        at
org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructNewS
erviceImplementation(AbstractServiceModelImpl.java:156)
......
Caused by: org.apache.hivemind.ApplicationRuntimeException: Unable to lookup
$Proxy0: $Proxy0
        at
org.apache.hivemind.service.impl.CtClassSource.getCtClass(CtClassSource.java
:60)
        at
org.apache.hivemind.service.impl.ClassFabImpl.addField(ClassFabImpl.java:71)
        at
org.apache.hivemind.service.impl.LoggingInterceptorFactory.createInfrastruct
ure(LoggingInterceptorFactory.java:236)
......
Caused by: javassist.NotFoundException: $Proxy0
        at javassist.ClassPoolTail.openClassfile(ClassPoolTail.java:300)
        at javassist.ClassPoolTail.checkClassName(ClassPoolTail.java:177)
        at javassist.ClassPool.checkClassName(ClassPool.java:709)
        at javassist.ClassPool.get0(ClassPool.java:572)
        at javassist.ClassPool.get(ClassPool.java:561)
        at
org.apache.hivemind.service.impl.CtClassSource.getCtClass(CtClassSource.java
:56)
        ... 48 more

The problem seems occurs when javassist want to find the class file in
classpath but cannot find it( Of course it cannot ).

If I put Transaction Interceptor before the Logging Interceptor, all works
well.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
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