P.S., the current HibernateContext could be leveraged to perform this
(this is exactly what it does through a TransactionLocal).

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bill
Burke
Sent: Tuesday, September 21, 2004 3:32 PM
To: hibernate list
Subject: [Hibernate] Hibernate aspects

Hi all,

I'm trying to brainstorm a list of aspects for Hibernate that could be 
written with JBoss AOP.

The first one I can think of is:

* Session injection.

public class AccountDAO {

   public @Injected(name="Sessionname") Session session;

}

When you access the session variable, it determine if you are within the

context of a transaction.  If so, it will automatically create the 
Hibernate session and associate it with the transaction.  When the 
transaction is finished the session will be closed.

We're also considering supporting local variable annotations, so instead

of a member variables, you could could use the annotation as a local 
variable

public void someMethod() {
    @Injected(name="Sessionname") Session session = null;
}

Any other you can think of?

Thanks,

Bill

-- 
================
Bill Burke
Chief Architect
JBoss Inc.
================




-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel




-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to