Hmm. Storing transactions in HTTP session is not that big deal.
The question is whether you can have multiple long transaction running
at the same time.
If so, you have to pass the current transaction token between pages
somehow. One possible relatively transparent solution that comes to my
mind is to have a TransactionalPage derived from WebPage, which would
have a token associated with it.
On request begin the RequestCycle would examine the page and if it finds
the token it would associate it with current request.
Every new TransactionalPage created during a request would examine the
current request and if it finds the token it would associate itself with
the token. (This would happen for pages created in link callbacks for
example).
And you would need a BookmarkabePageLink component that would add the
current token (obtained from ServletRequest) to the bookmarkable urls
(as a parameter). (Or use customized IRequestCodingStrategy for it)
This should propagate the transaction token between pages. But maybe
there is a simpler solution?
-Matej
Vincent Jenks wrote:
Easy enough to say, however, I don't know *how* Seam does what it does
- I have no idea how to implement something like this.
And yes, it's a long-running transaction (I suppose?) Perhaps they're
just storing the transaction in an http session so it's still relevant
to the user throughout the application before it's comitted and the
session is flushed.
I'm not really sure...
I guess that's the question then...would I have to resort to
bean-managed transactions, go outside of the container, and pass the
transaction around in a session until I decide to commit it? I'm
afraid that's out of the question and would complex enough *not* to
use EJB3 and just resort to using Wicket + Hibernate or Wicket +
Hibernate + Spring.
OpenSessionInView does work great, if you're using Hibernate! I'm not
using Hibernate. I'm using an entirely managed environment and am not
manually working w/ the session or the transaction.
I'm a relative newbie to most of you, I'm sure, so hopefully someone
can correct me where I'm making false assumptions.
On 5/31/06, Matej Knopp <[EMAIL PROTECTED]> wrote:
I don't know why but I just don't like the idea of long-running
transactions. I think web applications are just too unpredictable to
hold one transaction during multiple request. You can never be sure when
(and if) the next request will come.
OpenSessionInView filter has always be sufficient for me. I either load
all lazyly loaded collections in advance or re-associate the object with
session on every request.
I don't know seam internals either, but can't see a reason why it
shouldn't be possible to have long running transaction with wicket.
After all, transactions are not web layers responsibility.
-MAtej
Vincent Jenks wrote:
> I'm not sure how familiar anyone here is w/ Seam and how it applies to
> JSF when working w/ EJB3...but I thought I'd bring this up anyhow.
>
> You'll have to forgive my ignorance as I'm not entirely clear *how*
> Seam works internally and haven't built a project w/ it yet...but it
> seems to ease the pain that Hibernate users have long experienced w/
> LazyInitializationExceptions.
>
> I realize there's some sort of solition for plain 'ol Hibernate users
> in wicket-stuff, something about Spring? However, it's a different
> story when using EJB3 in the JBoss container w/ container-managed
> persistence.
>
> Apparently, Seam creates a long-running Hibernate session in the
> container that supposidly eliminates the LazyInitializationException.
>
> I've gotten quite comfortable w/ Wicket and hope to continue to use it
> for projects here at work...however working around lazily-loaded
> collections in EJB3 is becoming messy for me at times when the domain
> model becomes more than trivial. I have a great distaste for JSF and
> would rather not use it, believe me, but Seam is very compelling for
> large, complex projects where the LIE exception will be come much more
> likely.
>
> How hard would it be to implement something like Seam has to ease this
> problem? That is, assuming no one has come up w/ a solution yet...if
> there is one, please let me know!
>
> I've mentioned something like this in passing before and have gotten
> the usual response, which is "you need to use a session-per-request
> pattern". The problem is; I'm using a container...I don't have
> control of the hibernate session, the transactions (per se), etc. In
> an entirely container-managed environment I don't have the options I
> would w/ plain Hibernate.
>
> Thanks in advance!
>
>
> -------------------------------------------------------
> All the advantages of Linux Managed Hosting--Without the Cost and Risk!
> Fully trained technicians. The highest number of Red Hat
certifications in
> the hosting industry. Fanatical Support. Click to learn more
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat
certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user