On Nov 23, 2007 1:18 PM, Donyee <[EMAIL PROTECTED]> wrote:
>
> when i submit the editpage, i got a error:
> Illegal attempt to associate a collection with two open sessions
> ...

Donyee, i don't have time to look over you specific scenarion right
now, but you might be running into this:
https://issues.apache.org/jira/browse/TAPESTRY-1850

Related discussion:
http://article.gmane.org/gmane.comp.java.tapestry.user/53095

You can test the theory by overriding and aliasing the HSM in your AppModule:

@Scope(PERTHREAD_SCOPE)
public HibernateSessionManager buildPatchedSessionManager(
    HibernateSessionSource sessionSource,
    ThreadCleanupHub threadCleanupHub) {

    HibernateSessionManagerImpl manager =
        new HibernateSessionManagerImpl(sessionSource) {
            @Override public void threadDidCleanup() {
                super.threadDidCleanup();
                getSession().close();
            }
    };

    threadCleanupHub.addThreadCleanupListener(manager);
    return manager;
}

public void contributeAlias(
    Configuration<AliasContribution<?>> configuration,
    @InjectService("PatchedSessionManager")
    HibernateSessionManager extendedManager) {

    configuration.add(
        AliasContribution.create(
            HibernateSessionManager.class, extendedManager));
}

Cheers,
lasitha.

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

Reply via email to