You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Frank Tegtmeyer <ft...@fte.to> on 2009/06/09 15:36:16 UTC
Long JPA-Transactions (was: JPA EntityManager storage)
> Yes, but not all transactions are request-scoped. We have many times
> implemented asynchronous transactions, because the user didn't want to
> wait for the results.
Can you give a (high level) overview how to handle such a situation
in Wicket? I'm sure clients will demand such functionality someday
from my application.
I would use some kind of batch processing system with API calls to get
the status of the batch request. Or would this be overkill?
Regards, Frank
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions
Posted by nino martinez wael <ni...@gmail.com>.
Hmm if you refactor your "daos" or domain classes you still need to
manually change your xml files..
2009/6/10 Martin Sachs <sa...@gmail.com>:
>
> Spring will give you all feature you need and will need in a year...
>
> My Frameworks for my archetype: ;)
> - Wicket
> - Wicketstuff-jquery
> - Spring
> - singleton-beans for all short-running transactions
> - session-beans with extended EntityManager for long running tx (
> dont forget to commit the tx)
> - Hades (Generic JPA helper)
> - Quartz (Optional)
> - java.mail (Optional)
> - ActiveMQ (Optional)
> - asynch transactions
> - Maven build
>
> I use no IDE-Plugins or JPA plugins or ... just plain java IDE
>
> Martin
>
>
>
> nino martinez wael schrieb:
>> thats obviously catch a whale, hehe..
>>
>> 2009/6/9 nino martinez wael <ni...@gmail.com>:
>>
>>> The focus these days are to simplify frameworks, for instance take
>>> guice and warp persist. Really really simple to use and to setup.
>>> Spring has a bit to learn about java configuration from these guys (I
>>> last time I tried spring was in 2.5) however I've only tried guice
>>> 1.0.
>>>
>>> If it takes 1 day to utilize a framework that can find a whale, it's
>>> probably wort the effort. On the other hand if it requires 50% of the
>>> project plan, it's probably not.
>>>
>>> pro's with guice are: plain java (no need for extra tools, just like
>>> wicket), refactor safe, KISS, and works like I thought it would:)
>>>
>>> cons: a little more intrusive since configuration are in java,
>>> although very simple to extend to property files or db (it's just
>>> java)
>>>
>>> pros with spring: huge framework (you think of something, they
>>> probably got it somewhere), less intrusive
>>>
>>> cons: xml based, huge framework..
>>>
>>> Anyhow both frameworks go nicely with mocking etc...
>>>
>>> my 2 cents.
>>>
>>>
>>>
>>> 2009/6/9 Martin Makundi <ma...@koodaripalvelut.com>:
>>>
>>>>> Ok, I think we can just agree to disagree, but will you do me a favor?
>>>>> When (not if) you encounter a situation like Martijn is talking
>>>>> about, will you post back to the list?
>>>>>
>>>> I just believe in principle that hunting for some bug for 3 weeks is
>>>> much less waste than dragging some toolkit along for 3 years, 6-man
>>>> team, 100-man team, however big the more waste. Usually only few
>>>> people hunt for the bug for 3 weeks.
>>>>
>>>> And it is true, it is important to know what to do yourself and what not to.
>>>>
>>>> **
>>>> Martin
>>>>
>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions
Posted by Martin Sachs <sa...@gmail.com>.
Spring will give you all feature you need and will need in a year...
My Frameworks for my archetype: ;)
- Wicket
- Wicketstuff-jquery
- Spring
- singleton-beans for all short-running transactions
- session-beans with extended EntityManager for long running tx (
dont forget to commit the tx)
- Hades (Generic JPA helper)
- Quartz (Optional)
- java.mail (Optional)
- ActiveMQ (Optional)
- asynch transactions
- Maven build
I use no IDE-Plugins or JPA plugins or ... just plain java IDE
Martin
nino martinez wael schrieb:
> thats obviously catch a whale, hehe..
>
> 2009/6/9 nino martinez wael <ni...@gmail.com>:
>
>> The focus these days are to simplify frameworks, for instance take
>> guice and warp persist. Really really simple to use and to setup.
>> Spring has a bit to learn about java configuration from these guys (I
>> last time I tried spring was in 2.5) however I've only tried guice
>> 1.0.
>>
>> If it takes 1 day to utilize a framework that can find a whale, it's
>> probably wort the effort. On the other hand if it requires 50% of the
>> project plan, it's probably not.
>>
>> pro's with guice are: plain java (no need for extra tools, just like
>> wicket), refactor safe, KISS, and works like I thought it would:)
>>
>> cons: a little more intrusive since configuration are in java,
>> although very simple to extend to property files or db (it's just
>> java)
>>
>> pros with spring: huge framework (you think of something, they
>> probably got it somewhere), less intrusive
>>
>> cons: xml based, huge framework..
>>
>> Anyhow both frameworks go nicely with mocking etc...
>>
>> my 2 cents.
>>
>>
>>
>> 2009/6/9 Martin Makundi <ma...@koodaripalvelut.com>:
>>
>>>> Ok, I think we can just agree to disagree, but will you do me a favor?
>>>> When (not if) you encounter a situation like Martijn is talking
>>>> about, will you post back to the list?
>>>>
>>> I just believe in principle that hunting for some bug for 3 weeks is
>>> much less waste than dragging some toolkit along for 3 years, 6-man
>>> team, 100-man team, however big the more waste. Usually only few
>>> people hunt for the bug for 3 weeks.
>>>
>>> And it is true, it is important to know what to do yourself and what not to.
>>>
>>> **
>>> Martin
>>>
>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
Re: Long JPA-Transactions (was: JPA EntityManager storage)
Posted by nino martinez wael <ni...@gmail.com>.
thats obviously catch a whale, hehe..
2009/6/9 nino martinez wael <ni...@gmail.com>:
> The focus these days are to simplify frameworks, for instance take
> guice and warp persist. Really really simple to use and to setup.
> Spring has a bit to learn about java configuration from these guys (I
> last time I tried spring was in 2.5) however I've only tried guice
> 1.0.
>
> If it takes 1 day to utilize a framework that can find a whale, it's
> probably wort the effort. On the other hand if it requires 50% of the
> project plan, it's probably not.
>
> pro's with guice are: plain java (no need for extra tools, just like
> wicket), refactor safe, KISS, and works like I thought it would:)
>
> cons: a little more intrusive since configuration are in java,
> although very simple to extend to property files or db (it's just
> java)
>
> pros with spring: huge framework (you think of something, they
> probably got it somewhere), less intrusive
>
> cons: xml based, huge framework..
>
> Anyhow both frameworks go nicely with mocking etc...
>
> my 2 cents.
>
>
>
> 2009/6/9 Martin Makundi <ma...@koodaripalvelut.com>:
>>> Ok, I think we can just agree to disagree, but will you do me a favor?
>>> When (not if) you encounter a situation like Martijn is talking
>>> about, will you post back to the list?
>>
>> I just believe in principle that hunting for some bug for 3 weeks is
>> much less waste than dragging some toolkit along for 3 years, 6-man
>> team, 100-man team, however big the more waste. Usually only few
>> people hunt for the bug for 3 weeks.
>>
>> And it is true, it is important to know what to do yourself and what not to.
>>
>> **
>> Martin
>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions (was: JPA EntityManager storage)
Posted by nino martinez wael <ni...@gmail.com>.
The focus these days are to simplify frameworks, for instance take
guice and warp persist. Really really simple to use and to setup.
Spring has a bit to learn about java configuration from these guys (I
last time I tried spring was in 2.5) however I've only tried guice
1.0.
If it takes 1 day to utilize a framework that can find a whale, it's
probably wort the effort. On the other hand if it requires 50% of the
project plan, it's probably not.
pro's with guice are: plain java (no need for extra tools, just like
wicket), refactor safe, KISS, and works like I thought it would:)
cons: a little more intrusive since configuration are in java,
although very simple to extend to property files or db (it's just
java)
pros with spring: huge framework (you think of something, they
probably got it somewhere), less intrusive
cons: xml based, huge framework..
Anyhow both frameworks go nicely with mocking etc...
my 2 cents.
2009/6/9 Martin Makundi <ma...@koodaripalvelut.com>:
>> Ok, I think we can just agree to disagree, but will you do me a favor?
>> When (not if) you encounter a situation like Martijn is talking
>> about, will you post back to the list?
>
> I just believe in principle that hunting for some bug for 3 weeks is
> much less waste than dragging some toolkit along for 3 years, 6-man
> team, 100-man team, however big the more waste. Usually only few
> people hunt for the bug for 3 weeks.
>
> And it is true, it is important to know what to do yourself and what not to.
>
> **
> Martin
>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions (was: JPA EntityManager storage)
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
> Ok, I think we can just agree to disagree, but will you do me a favor?
> When (not if) you encounter a situation like Martijn is talking
> about, will you post back to the list?
I just believe in principle that hunting for some bug for 3 weeks is
much less waste than dragging some toolkit along for 3 years, 6-man
team, 100-man team, however big the more waste. Usually only few
people hunt for the bug for 3 weeks.
And it is true, it is important to know what to do yourself and what not to.
**
Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions (was: JPA EntityManager storage)
Posted by James Carman <jc...@carmanconsulting.com>.
On Tue, Jun 9, 2009 at 11:32 AM, Martin
Makundi<ma...@koodaripalvelut.com> wrote:
>> Keep convincing yourself that transaction and connection management is easy.
>
> All I can do is try to make it easy by design :)
Ok, I think we can just agree to disagree, but will you do me a favor?
When (not if) you encounter a situation like Martijn is talking
about, will you post back to the list?
Using Spring (or any other battle-tested framework that does something
similar) isn't about whales vs. guppies. It's about using the tool
that you know works. The good thing is that if you start off with the
tool that can work for all situations, but you only use the pieces
that you need for your particular situation (Spring is partitioned so
that you can do that), you can always pick up other stuff if you need
it later. If you write your own, you have to keep writing your own to
add functionality or switch later, which can be very painful.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions (was: JPA EntityManager storage)
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
> Having gone through 3 weeks of connection leak hunting because we
> reasoned like this and implemented our own connection and transaction
> management solution (Not Invented Here), I can say with confidence:
> this is not Premature Optimization.
Got to know your limits ;) That's a whale ...
> Keep convincing yourself that transaction and connection management is easy.
All I can do is try to make it easy by design :)
**
Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions (was: JPA EntityManager storage)
Posted by Martijn Dashorst <ma...@gmail.com>.
On Tue, Jun 9, 2009 at 5:12 PM, Martin
Makundi<ma...@koodaripalvelut.com> wrote:
> I say that for most cases, spring is your "premature optimization".
Having gone through 3 weeks of connection leak hunting because we
reasoned like this and implemented our own connection and transaction
management solution (Not Invented Here), I can say with confidence:
this is not Premature Optimization.
I have no special love for Spring, nor its oodles of XML
configuration. But with a couple of small lines of XML you can
configure it to scan your entities and services and automatically wire
things up for transparent connection and transaction management.
Keep convincing yourself that transaction and connection management is easy.
Martijn
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions (was: JPA EntityManager storage)
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
No, but when I am not looking for whales, I fish just using the
fishing string and a hook with a worm tied to it.
**
Martin
2009/6/9 James Carman <jc...@carmanconsulting.com>:
> Yeah, and do you carve a fishing pole from a tree every time you want
> to go fishing?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions (was: JPA EntityManager storage)
Posted by James Carman <jc...@carmanconsulting.com>.
Yeah, and do you carve a fishing pole from a tree every time you want
to go fishing?
On Tue, Jun 9, 2009 at 11:12 AM, Martin
Makundi<ma...@koodaripalvelut.com> wrote:
> I say that for most cases, spring is your "premature optimization".
> Often it's not necessary to go further than the sea to fish. 20:80
> rule of thumb.
>
> **
> Martin
>
> 2009/6/9 Martijn Dashorst <ma...@gmail.com>:
>> Though Spring is a giant beast, it is a very nice one shop stop for
>> your connection pooling, datasourcing, hibernate configuring,
>> transaction demarcating problems. Say no to connection leaks: use
>> Spring!
>>
>> Martijn
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions (was: JPA EntityManager storage)
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
I say that for most cases, spring is your "premature optimization".
Often it's not necessary to go further than the sea to fish. 20:80
rule of thumb.
**
Martin
2009/6/9 Martijn Dashorst <ma...@gmail.com>:
> Though Spring is a giant beast, it is a very nice one shop stop for
> your connection pooling, datasourcing, hibernate configuring,
> transaction demarcating problems. Say no to connection leaks: use
> Spring!
>
> Martijn
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions (was: JPA EntityManager storage)
Posted by Martijn Dashorst <ma...@gmail.com>.
I tend to side with James. Though it seems like something you can
quickly pull out of your hat, transaction demarcation in combination
with proper connection pooling in web applications is something you'd
better get from a well tested, widely used framework rather than
suffer from NIH syndrome. Been there, done that, never doing it again.
Though Spring is a giant beast, it is a very nice one shop stop for
your connection pooling, datasourcing, hibernate configuring,
transaction demarcating problems. Say no to connection leaks: use
Spring!
Martijn
On Tue, Jun 9, 2009 at 4:48 PM, James
Carman<jc...@carmanconsulting.com> wrote:
> On Tue, Jun 9, 2009 at 10:44 AM, Martin
> Makundi<ma...@koodaripalvelut.com> wrote:
>> Well, the executors themselves sure Start and Stop differently, but
>> they can use same invocations for starting/stopping the entitymanagers
>> (actually: in the discussed example the hooks used in Wicket are from
>> EntityManagerUtils -class and they are the only hooks available even
>> if hooking from an Executor).
>
> I mean you can't use the beginRequest/endRequest stuff from Wicket to
> demarcate your transactions when you're doing things asynchronously.
> It's not a hard problem to solve by any means, but it is something you
> must address.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.5 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions (was: JPA EntityManager storage)
Posted by James Carman <jc...@carmanconsulting.com>.
On Tue, Jun 9, 2009 at 10:44 AM, Martin
Makundi<ma...@koodaripalvelut.com> wrote:
> Well, the executors themselves sure Start and Stop differently, but
> they can use same invocations for starting/stopping the entitymanagers
> (actually: in the discussed example the hooks used in Wicket are from
> EntityManagerUtils -class and they are the only hooks available even
> if hooking from an Executor).
I mean you can't use the beginRequest/endRequest stuff from Wicket to
demarcate your transactions when you're doing things asynchronously.
It's not a hard problem to solve by any means, but it is something you
must address.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions (was: JPA EntityManager storage)
Posted by James Carman <jc...@carmanconsulting.com>.
On Tue, Jun 9, 2009 at 9:36 AM, Frank Tegtmeyer<ft...@fte.to> wrote:
> Can you give a (high level) overview how to handle such a situation
> in Wicket? I'm sure clients will demand such functionality someday
> from my application.
> I would use some kind of batch processing system with API calls to get
> the status of the batch request. Or would this be overkill?
I use Spring's TaskExecutor API to do it along with the
ThreadPoolTaskExecutor as the implementation. Since I use Spring's
@Transactional annotation and AspectJ to enforce it, I don't have to
worry about making sure I begin/commit my transactions. That's all
handled for me. What I have had to do, though, is set up a mechanism
whereby I can run a Runnable task as someone else (the person who
submitted the job for instance). But, I do that with a simple "run
as" wrapper (using Acegi/Spring Security).
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions (was: JPA EntityManager storage)
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
> On Tue, Jun 9, 2009 at 9:40 AM, Martin
>> In most cases I would make it thread-scoped anyways so the same
>> structure applies.
>
> Right, but you can't use the same "hooks" to start/stop your
> transactions that you do with Wicket. You have to do it at the
> executor level, while it executes the "job" or "task" or whatever you
> want to call it.
Well, the executors themselves sure Start and Stop differently, but
they can use same invocations for starting/stopping the entitymanagers
(actually: in the discussed example the hooks used in Wicket are from
EntityManagerUtils -class and they are the only hooks available even
if hooking from an Executor).
**
Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions (was: JPA EntityManager storage)
Posted by James Carman <jc...@carmanconsulting.com>.
On Tue, Jun 9, 2009 at 9:40 AM, Martin
Makundi<ma...@koodaripalvelut.com> wrote:
> In most cases I would make it thread-scoped anyways so the same
> structure applies.
>
Right, but you can't use the same "hooks" to start/stop your
transactions that you do with Wicket. You have to do it at the
executor level, while it executes the "job" or "task" or whatever you
want to call it.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Long JPA-Transactions (was: JPA EntityManager storage)
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
In most cases I would make it thread-scoped anyways so the same
structure applies.
**
Martin
2009/6/9 Frank Tegtmeyer <ft...@fte.to>:
>> Yes, but not all transactions are request-scoped. We have many times
>> implemented asynchronous transactions, because the user didn't want to
>> wait for the results.
>
> Can you give a (high level) overview how to handle such a situation
> in Wicket? I'm sure clients will demand such functionality someday
> from my application.
> I would use some kind of batch processing system with API calls to get
> the status of the batch request. Or would this be overkill?
>
> Regards, Frank
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org