You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by jpswain <jp...@gmail.com> on 2008/08/24 05:11:07 UTC

My Wicket + Hibernate project- Transaction solutions? Java EE w/ Wicket?

I'm just curious what everyone is using for transaction management.  I have
been working with Wicket for a while now (and loving it) on a pet project
that also uses Hibernate and Guice.  
I'm realizing now that I might need/want transactional support for a couple
parts of my app.  

I don't have any experience with Spring or Java EE or EJB, but have been
avoiding Spring because of what I have read and seen online with so much
XML-coding.  Is it possible to use spring transaction module by itself and
without too much XML?  I'd really appreciate hearing what y'all are you guys
using for your transactional needs.

Also is it possible to run a Wicket-based project inside a JEE container
like Glassfish or JBoss AS directly to take advantage of EJB & JTA, 
or would that require something like Seam + wicket-seam integration?

If anyone has recommendations on where to get started with transactions,
that would be great too.

Thanks!
J
-- 
View this message in context: http://www.nabble.com/My-Wicket-%2B-Hibernate-project--Transaction-solutions--Java-EE-w--Wicket--tp19127403p19127403.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: My Wicket + Hibernate project- Transaction solutions? Java EE w/ Wicket?

Posted by David Blevins <da...@visi.com>.


jpswain wrote:
> 
> I'm just curious what everyone is using for transaction management.  I
> have been working with Wicket for a while now (and loving it) on a pet
> project that also uses Hibernate and Guice.  
> I'm realizing now that I might need/want transactional support for a
> couple parts of my app.  
> 
> I don't have any experience with Spring or Java EE or EJB, but have been
> avoiding Spring because of what I have read and seen online with so much
> XML-coding.  Is it possible to use spring transaction module by itself and
> without too much XML?  I'd really appreciate hearing what y'all are you
> guys using for your transactional needs.
> 
> Also is it possible to run a Wicket-based project inside a JEE container
> like Glassfish or JBoss AS directly to take advantage of EJB & JTA, 
> or would that require something like Seam + wicket-seam integration?
> 
> If anyone has recommendations on where to get started with transactions,
> that would be great too.
> 
> Thanks!
> J
> 

If you're using Tomcat then you can drop in the OpenEJB war file [1] and get
some EE support added for free with zero extra config and no additional xml. 
Should take only a minute or two to get going.  You can add EJBs right in
your webapp (no ears required) and get all the transactional support and JTA
EntityManager support, etc.  You can even unit test the EJBs with the
embeddable EJB container support.

There is also an example zip on the download page that has an
openejb+hibernate maven/ant project all setup and ready to go.

-David

[1] http://openejb.apache.org/download.html

-- 
View this message in context: http://www.nabble.com/My-Wicket-%2B-Hibernate-project--Transaction-solutions--Java-EE-w--Wicket--tp19127403p19170589.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: My Wicket + Hibernate project- Transaction solutions? Java EE w/ Wicket?

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
take a look at the wicket iolite archetype. it uses spring and jpa 
hiberhatne..

jpswain wrote:
> I'm just curious what everyone is using for transaction management.  I have
> been working with Wicket for a while now (and loving it) on a pet project
> that also uses Hibernate and Guice.  
> I'm realizing now that I might need/want transactional support for a couple
> parts of my app.  
>
> I don't have any experience with Spring or Java EE or EJB, but have been
> avoiding Spring because of what I have read and seen online with so much
> XML-coding.  Is it possible to use spring transaction module by itself and
> without too much XML?  I'd really appreciate hearing what y'all are you guys
> using for your transactional needs.
>
> Also is it possible to run a Wicket-based project inside a JEE container
> like Glassfish or JBoss AS directly to take advantage of EJB & JTA, 
> or would that require something like Seam + wicket-seam integration?
>
> If anyone has recommendations on where to get started with transactions,
> that would be great too.
>
> Thanks!
> J
>   

-- 
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: My Wicket + Hibernate project- Transaction solutions? Java EE w/ Wicket?

Posted by Maarten Bosteels <mb...@gmail.com>.
On Tue, Aug 26, 2008 at 5:17 PM, James Perry
<ja...@gmail.com>wrote:

> On Sun, Aug 24, 2008 at 4:11 AM, jpswain <jp...@gmail.com> wrote:
> >
> > I'm just curious what everyone is using for transaction management.  I
> have
> > been working with Wicket for a while now (and loving it) on a pet project
> > that also uses Hibernate and Guice.
> > I'm realizing now that I might need/want transactional support for a
> couple
> > parts of my app.
>
> I can't comment on Guide as it's not something I've evaluated yet
> however I do like some of its idiosyncrasies. I use Spring/Hibernate
> as my stack and I find it fits perfectly with Wicket and my domain
> models. I personally think Spring offers rich transaction management
> with its transaction managers, DAO template classes and generic DAO
> exception hierarchy.
>
> > I don't have any experience with Spring or Java EE or EJB, but have been
> > avoiding Spring because of what I have read and seen online with so much
> > XML-coding.  Is it possible to use spring transaction module by itself
> and
> > without too much XML?  I'd really appreciate hearing what y'all are you
> guys
> > using for your transactional needs.
>
> As of Spring 2.5, you can configure your beans with non-evasive, fine
> grained annotations. It's declarative transaction model is now
> annotation based (as of Spring 2.0) so you can make your methods
> transactional using the @Transactional annotation


Same here: no experience with Guice, but Spring's @Transactional (with the
Connection and TransactionStatus being bound to the current thread etc) is
working just great.

Also the spring helper-classes for junit (or testng) that rollback your
transaction after every test are very convenient.


> and it can even be
> declared on an interface.


Yes, but note this:

"The Spring team's recommendation is that you only annotate concrete classes
with the @Transactional annotation, as opposed to annotating interfaces. You
certainly can place the @Transactional annotation on an interface (or an
interface method), but this will only work as you would expect it to if you
are using interface-based proxies. "

Maarten


> The propagation and isolation can also fine
> tuned like:
>
> @Transactional(propagation=Propagation.NOT_SUPPORTED, readOnly=false)
> void updateOrderLineQuantities(List<OrderLine> orderLines);
>
> Read this chapter to understand how Spring does transaction management:
>
>
> http://static.springframework.org/spring/docs/2.5.x/reference/transaction.html
>
> Best,
> James.
>
> > If anyone has recommendations on where to get started with transactions,
> > that would be great too.
> >
> > Thanks!
> > J
> > --
> > View this message in context:
> http://www.nabble.com/My-Wicket-%2B-Hibernate-project--Transaction-solutions--Java-EE-w--Wicket--tp19127403p19127403.html
> > Sent from the Wicket - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > 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: My Wicket + Hibernate project- Transaction solutions? Java EE w/ Wicket?

Posted by James Perry <ja...@gmail.com>.
On Sun, Aug 24, 2008 at 4:11 AM, jpswain <jp...@gmail.com> wrote:
>
> I'm just curious what everyone is using for transaction management.  I have
> been working with Wicket for a while now (and loving it) on a pet project
> that also uses Hibernate and Guice.
> I'm realizing now that I might need/want transactional support for a couple
> parts of my app.

I can't comment on Guide as it's not something I've evaluated yet
however I do like some of its idiosyncrasies. I use Spring/Hibernate
as my stack and I find it fits perfectly with Wicket and my domain
models. I personally think Spring offers rich transaction management
with its transaction managers, DAO template classes and generic DAO
exception hierarchy.

> I don't have any experience with Spring or Java EE or EJB, but have been
> avoiding Spring because of what I have read and seen online with so much
> XML-coding.  Is it possible to use spring transaction module by itself and
> without too much XML?  I'd really appreciate hearing what y'all are you guys
> using for your transactional needs.

As of Spring 2.5, you can configure your beans with non-evasive, fine
grained annotations. It's declarative transaction model is now
annotation based (as of Spring 2.0) so you can make your methods
transactional using the @Transactional annotation and it can even be
declared on an interface. The propagation and isolation can also fine
tuned like:

@Transactional(propagation=Propagation.NOT_SUPPORTED, readOnly=false)
void updateOrderLineQuantities(List<OrderLine> orderLines);

Read this chapter to understand how Spring does transaction management:

http://static.springframework.org/spring/docs/2.5.x/reference/transaction.html

Best,
James.

> If anyone has recommendations on where to get started with transactions,
> that would be great too.
>
> Thanks!
> J
> --
> View this message in context: http://www.nabble.com/My-Wicket-%2B-Hibernate-project--Transaction-solutions--Java-EE-w--Wicket--tp19127403p19127403.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: My Wicket + Hibernate project- Transaction solutions? Java EE w/ Wicket?

Posted by francisco treacy <fr...@gmail.com>.
one thing you can do is use wicket with guice and hibernate, and have
warp-persist ( http://www.wideplay.com/guicewebextensions2 ) for
transactions.

it's a nice stack that i use, a lightweight alternative to spring. and
no need for java ee containers.

you can have a look here:
http://www.richard-wilkinson.co.uk/2008/04/19/wicket-guice-and-warp-persist/
 and here http://code.google.com/p/warp-persist-sample/ .

francisco



On Sun, Aug 24, 2008 at 5:44 AM, Patrick Angeles <pa...@inertiabev.com> wrote:
>
> You can use annotations or spring-javaconfig with Spring if you don't want to
> go through too much XML configuration. That criticism is really unwarranted
> these days. The annotation-style configuration is very similar to how Guice
> works, whereas spring-javaconfig is basically like writing the spring.xml
> file in Java code. The latter is nice in that all the wiring is centralized,
> but you still get the benefits of working with a Java IDE, such as
> refactoring or searching for occurences.
>
> There's probably some easy way to hook Guice up with the Spring transaction
> manager, but I've never tried.
>
> And yes, you should be able to run Wicket in an EJB3 Container, but you'll
> have to deal with some boilerplate code that will allow you to inject your
> EJB3 services into Wicket components...
>
> Personally, I would recommend going with Wicket, Spring and Hibernate (or
> JPA) via spring-javaconfig.
>
>
> jpswain wrote:
>>
>> I'm just curious what everyone is using for transaction management.  I
>> have been working with Wicket for a while now (and loving it) on a pet
>> project that also uses Hibernate and Guice.
>> I'm realizing now that I might need/want transactional support for a
>> couple parts of my app.
>>
>> I don't have any experience with Spring or Java EE or EJB, but have been
>> avoiding Spring because of what I have read and seen online with so much
>> XML-coding.  Is it possible to use spring transaction module by itself and
>> without too much XML?  I'd really appreciate hearing what y'all are you
>> guys using for your transactional needs.
>>
>> Also is it possible to run a Wicket-based project inside a JEE container
>> like Glassfish or JBoss AS directly to take advantage of EJB & JTA,
>> or would that require something like Seam + wicket-seam integration?
>>
>> If anyone has recommendations on where to get started with transactions,
>> that would be great too.
>>
>> Thanks!
>> J
>>
>
> --
> View this message in context: http://www.nabble.com/My-Wicket-%2B-Hibernate-project--Transaction-solutions--Java-EE-w--Wicket--tp19127403p19127522.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: My Wicket + Hibernate project- Transaction solutions? Java EE w/ Wicket?

Posted by Patrick Angeles <pa...@inertiabev.com>.
You can use annotations or spring-javaconfig with Spring if you don't want to
go through too much XML configuration. That criticism is really unwarranted
these days. The annotation-style configuration is very similar to how Guice
works, whereas spring-javaconfig is basically like writing the spring.xml
file in Java code. The latter is nice in that all the wiring is centralized,
but you still get the benefits of working with a Java IDE, such as
refactoring or searching for occurences.

There's probably some easy way to hook Guice up with the Spring transaction
manager, but I've never tried.

And yes, you should be able to run Wicket in an EJB3 Container, but you'll
have to deal with some boilerplate code that will allow you to inject your
EJB3 services into Wicket components...

Personally, I would recommend going with Wicket, Spring and Hibernate (or
JPA) via spring-javaconfig. 


jpswain wrote:
> 
> I'm just curious what everyone is using for transaction management.  I
> have been working with Wicket for a while now (and loving it) on a pet
> project that also uses Hibernate and Guice.  
> I'm realizing now that I might need/want transactional support for a
> couple parts of my app.  
> 
> I don't have any experience with Spring or Java EE or EJB, but have been
> avoiding Spring because of what I have read and seen online with so much
> XML-coding.  Is it possible to use spring transaction module by itself and
> without too much XML?  I'd really appreciate hearing what y'all are you
> guys using for your transactional needs.
> 
> Also is it possible to run a Wicket-based project inside a JEE container
> like Glassfish or JBoss AS directly to take advantage of EJB & JTA, 
> or would that require something like Seam + wicket-seam integration?
> 
> If anyone has recommendations on where to get started with transactions,
> that would be great too.
> 
> Thanks!
> J
> 

-- 
View this message in context: http://www.nabble.com/My-Wicket-%2B-Hibernate-project--Transaction-solutions--Java-EE-w--Wicket--tp19127403p19127522.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org