Issue Details (XML | Word | Printable)

Key: HIVEMIND-54
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Won't Fix
Priority: Major Major
Assignee: Howard M. Lewis Ship
Reporter: Yuxiang Bu
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
HiveMind

Request for built-in support for Hibernate in HiveMind lib

Created: 13/Sep/04 09:24 AM   Updated: 06/May/06 10:53 PM
Return to search
Component/s: documentation, examples, hivebuild
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Zip Archive Licensed for inclusion in ASF works doconline.zip 2004-09-14 04:51 PM Yuxiang Bu 17 kB
Zip Archive Licensed for inclusion in ASF works hivemind-article.zip 2004-10-03 11:51 PM James Carman 48 kB
GZip Archive Licensed for inclusion in ASF works hivemind-hibernate.tar.gz 2004-09-13 02:15 PM Jimmi Dyson 5 kB
Zip Archive Licensed for inclusion in ASF works hivemind.hibernate.zip 2004-10-20 03:03 PM Jean-Francois Poilpret 144 kB

Resolution Date: 06/May/06 10:53 PM


 Description  « Hide
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.constructNewServiceImplementation(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.createInfrastructure(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.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no subversion log entries for this issue yet.