Hi,

The problem here is that the proxy generated by Tapestry doesn't implement SessionImplementor. You'll have to get the SessionFactory and grab a Session from there if you want to do this.

I don't use tapestry-hibernate so that's all I can say about that.

By the way, the Session/SessionImplementor interfaces and the way they're used isn't bad design - it's exactly what interfaces are for. :)

-Filip

Britske skrev:
When injecting a (hibernate) Session a proxy to the actual session is
returned.
However, when using the session in a lot of my dao-services I need to have
access to the 'real' underlying session instead of just the proxy. Is there a way to do this?

Some background: after revisioning my dao/repository layer a bit I want to rely on
hibernate's DetachedCriteria for a lot of queries. THis basically enables
you to build hibernate criteria's without having a session handy. (very
useful in the light of MVC, etc. ) However, when actually executing these
detachedcriteria through detachedcrit.getExecutableCriteria(Session session)
a 'real' session has to be supplied since the method makes uses the
underlying implementation instead of just the session-interface. (bad
design, I know)

Anyone?

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

Reply via email to