Spring transaction handling makes some things so much easier. For
example, on an admin page, I may want to simply save changes to an
object by making a call to a makePersistent() method on a DAO. Of
course I want that to be committed. That's why I said
"makePersistent()" On the other hand, I mi
This now is all in the realm of Spring so I don't want to say too much...
Essentially, it doesn't matter how many 'nested' method calls you
make, [with PROPAGATION_REQUIRED] the transaction will rollback to
(and commit at) where the annotation was first encountered.
See the Spring docs for more:
Can you elaborate a bit more the part below
Steve Eynon wrote
>
> unlike T5's @CommitAfter, it doesn't always commit or start a new
> transaction.
>
The T5 annotation always commits when there is not RuntimeException so what
does @Transactional annotation does then :S
tnx
--
View this mes
Yeah, you can put the Spring @Transactional annotation on any Spring
bean / service. Both on the class and its methods.
The propagation=Propagation.REQUIRED ensures the code runs inside a
transaction but unlike T5's @CommitAfter, it doesn't always commit or
start a new transaction. It sounds like
So you put your transactional annotation on the DAO, right? The CommitAfter
does that for me as well, what I need is to put it on some layer above that
has multiple contats to the couple of different DAOs. One that saves one
part of the transaction, other that saves another but the should fail or
s
Our dependencies are configured via Ivy:
And yes, you need to use the Spring filter in your web.xml because
your transactional services will be Spring services - configured in
the usual Spring way via the application-context.xml.
Example DAO:
import org.springframewor
Hi Steve,
Thanks for posting. Can I ask you to help a bit more :)
I have tried adding to pom tapestry-spring but it didn't resolve everything.
I was under the impression that tapestry-spring includes everything spring
related that is needed. The missing dependencies are related to hibernate
impo
Here is our implementation with Spring 3.1.0 - it lets you use the
Spring transaction annotations on your Spring services.
First in your module:
public static void bind(ServiceBinder binder) {
binder.bind(ComponentRequestFilter.class,
OpenSpringSessionInViewFilter.class).withSimpleId();
}
You are right I wont pollute this mail thread with that anymore, I will try
to do a bit more research on one vs the other.
But in the mean time if anyone has any suggestion and nice links about
spring-transactions and OSIVF please share it will be of great help
cheers
--
View this message in con
This is not a topic for this mailing list. There is plenty of other discussions
about this elsewhere on the Internet.
Suffice it to say that after doing extensive research I came to a confusion
that JEE is the way to go for back end services with transactions and tapestry
for the web front end.
How so? It was my impression that spring is more lightweight then EJB and all
that come with it so it is less dependent, am I wrong?
tnx
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Tapestry-Transactions-tp5713299p5713341.html
Sent from the Tapestry - User mailing list
I would not use spring in any new projects. Just my opinion though.
On May 22, 2012, at 4:59 PM, bhorvat wrote:
> I have been reading up a bit on all of this transactions (as I am not that
> familiar with it yet :) ), and the last thing that I have read is
> http://static.springsource.org/sprin
I have been reading up a bit on all of this transactions (as I am not that
familiar with it yet :) ), and the last thing that I have read is
http://static.springsource.org/spring/docs/2.0.x/reference/transaction.html
It seams to me that transactions that offer EJB like CMT are a bit more
heavyweig
Sorry, not what I meant to say at all.
You can use CMT (Container-Managed Transactions)
The commit happens automatically at the end of your business method and nested
and XA transactions are supported via annotations.
On May 22, 2012, at 2:41 PM, Lenny Primak wrote:
> No. You can use BMP (Bea
No. You can use BMP (Bean-Managed Persistence).
The commit happens automatically at the end of your business method and nested
and XA transactions are supported via annotations.
On May 22, 2012, at 2:36 PM, bhorvat wrote:
> With JEE transaction I would have to handle everything manually? L
With JEE transaction I would have to handle everything manually? Like so
UserTransaction transaction = (UserTransaction)new
InitialContext().lookup("java:comp/UserTransaction");
transaction.begin();
EntityManager em = getEntityManager();
Employee employee = em.find(Employee.class, id);
employee.s
So currently I have a method addItem and removeItem in in there I create
couple of entities and remove a couple. Now in those methods I have call to
services that only handle single entities (it is just a hibernate CRUD), and
this works fine because on the interface of them I have @CommitAfter.
H
How about just using JEE transactions? It's very easy and it's what the whole
thing is built for. I am using these with great success in my not-so-small
project.
On May 22, 2012, at 2:20 PM, bhorvat wrote:
>
> Thiago H de Paula Figueiredo wrote
>>
>> On Tue, 22 May 2012 14:19:28 -0300, b
On Tue, 22 May 2012 15:20:44 -0300, bhorvat
wrote:
thing is I have tried puting @CommitAfter on methods like that but it
didn't work in cases I am trying to delete a bunch of entities.
Define 'didn't work'. From a transaction standpoint, updating, inserting
and deleting is all the same t
Thiago H de Paula Figueiredo wrote
>
> On Tue, 22 May 2012 14:19:28 -0300, bhorvat
> wrote:
>
>> So tapestry now replaces the need for OSIVF, right?
>
> tapestry-hibernate and tapestry-jpa solve the same problem as OSIVF but
> without using a filter. Instead, it uses perth
Hi Howard and tnx for joining in the fun.
If you dont mind can you share a bit more light on what do you think in 5.4
will be in regards to this problem. How do you plan to move as you have said
it yourself in the direction in which the web is going.
Howard Lewis Ship wrote
>
> However, more
On Tue, 22 May 2012 14:19:28 -0300, bhorvat
wrote:
So tapestry now replaces the need for OSIVF, right?
tapestry-hibernate and tapestry-jpa solve the same problem as OSIVF but
without using a filter. Instead, it uses perthread services.
So if I use spring then I dont need this CommitAft
Tapestry's built-in Hibernate/JPA support is very close to OpenSessionInView.
It's lazier, I believe, than Springs. The Session is created on first
usage (via the magic of lazy proxies).
In any case, the transaction extends to the end of the request, and is
then aborted.
The challenge is never d
OpenSessionInViewFilter has nothing to do with detached entities, it only
keeps session open till view is rendered otherwise lazy loading will no
work. The filter is trying to solve it by always opening session in every
request and closing it at the end. Tapestry hibernate opens session only
when
> Say that you
> load an object and that object has a list of objects in it, and you try to
> access the list in the tml page with say the loop component. Now if you
> dont
> use the OpenSessionInViewFilter you should get an exception
> (LazyInitalization).
> Yes but only if the session is c
OpenSessionInViewFilter has nothing to do with detached entities, it only keeps
session open till view is rendered otherwise lazy loading will no work. The
filter is trying to solve it by always opening session in every request and
closing it at the end. Tapestry hibernate opens session only whe
On Tue, May 22, 2012 at 3:59 PM, bhorvat wrote:
> The thing is I am not sure for what it is used in the first place. Based on
> everything that I have read it it seams to me that you use it to keep the
> session open until you are done with the rendering of the tml.
Yes. The hibernate session (j
The thing is I am not sure for what it is used in the first place. Based on
everything that I have read it it seams to me that you use it to keep the
session open until you are done with the rendering of the tml. Say that you
load an object and that object has a list of objects in it, and you try t
On Tue, May 22, 2012 at 3:34 PM, bhorvat wrote:
> Any thoughts on OpenSessionInViewFilter?
>
Yes. It's an anipattern (search it on google). Don't use it. I avoid
detached entities, or keeping them in some serialized form.
tapestry's ValueEncoder principle follows the principle of converting
cli
The blog looks nice but this is not something that I would like to include my
self. btw did you try out his example or did you just stumble upon?
cheers
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Tapestry-Transactions-tp5713299p5713310.html
Sent from the Tapestry - Us
Any thoughts on OpenSessionInViewFilter?
Is there any tapestry spring transaction example that you know of?
cheers
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Tapestry-Transactions-tp5713299p5713309.html
Sent from the Tapestry - User mailing list archive at Nabble.co
Here's a nice blog post form tawus fro extended transactional support
http://tawus.wordpress.com/2011/04/23/tapestry-magic-5-advising-services/
Cheers,
Dragan Sahpaski
On Tue, May 22, 2012 at 1:47 PM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:
> On Tue, 22 May 2012 07:42:08 -03
On Tue, 22 May 2012 07:42:08 -0300, bhorvat
wrote:
What is the best way to handle complex transaction in Tapestry?
As Tapestry nor Tapestry-IoC don't have support for more complex
transaction scenarios, maybe you should consider using Spring or EJB for
them.
--
Thiago H. de Paula Figu
33 matches
Mail list logo