How do I access the BEAN itself that is bound on CFORMS with bean binding 
framework?

To be more specific, how to I access/reference the bean from: 1.Inside the 
cform template file and
2 . Inside the cform binding file?

I was trying to do the following from the form template: 

<jx:set var="hibsession" value="${services.HibernateSession.current()}" />
<jx:set var="lockedobj" value="${hibsession.lock(.)}" />  

Although the form displays, the code seems to fail to execute.

Doing the following:

  <p><jx:out value="#{.}" /> </p>

Does display: [object Object]
But the problem is that I cannot seem to be able to call methods on it.

I explain what I want to achieve with this:

I want to be able to reattach an object to a new hibernate session on the view 
(template).

Normally the pattern used with hibernate lazy initialized objects and CForms is 
the: “session
closed on view pattern”.  This means the session is passed/stored on the 
“request header” and will
be closed normally by a servlet filter on the view. Examples of this can be 
found on the cocoon
mailing list, and also on the “Hibernate Fast” book and on the Cocoon wiki for 
hibernate.

The problem with this is that it moves a lot of the code that has to do with 
transactions,
sessions from Java into Cocoon.

The “hibernate in action” book mentions that a good alternative to keeping the 
session open is to
simply leave your Java methods as they are (closing the sessions) and reopen 
the sessions on the
view and reattaching the objects (lock method).

I wonder if anybody would be able to help me achieving this reopening and 
reattachment of the
session.

Has anybody perhaps already tried this?  Are you satisfied with the results?



                
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com

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

Reply via email to