Re: How to programmatically get PlatformTransactionManager of a DAO ?

2010-12-19 Thread Zilvinas Vilutis
why don't you expose a "getTxManagerUser" method in your AbstractDao class?

regards


Žilvinas Vilutis

Mobile:   (+370) 652 38353
E-mail:   cika...@gmail.com



On Sat, Dec 18, 2010 at 9:36 AM, smallufo  wrote:
> Thanks.
> but declarative txManagement add a lot of complexity to XMLs
> Is there any other option ?
>
>
> 2010/12/19 James Carman 
>
>> declarative transaction management
>

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



Re: How to programmatically get PlatformTransactionManager of a DAO ?

2010-12-18 Thread James Carman
Use annotations
On Dec 18, 2010 11:37 AM, "smallufo"  wrote:
> Thanks.
> but declarative txManagement add a lot of complexity to XMLs
> Is there any other option ?
>
>
> 2010/12/19 James Carman 
>
>> declarative transaction management


Re: How to programmatically get PlatformTransactionManager of a DAO ?

2010-12-18 Thread smallufo
Thanks.
but declarative txManagement add a lot of complexity to XMLs
Is there any other option ?


2010/12/19 James Carman 

> declarative transaction management


Re: How to programmatically get PlatformTransactionManager of a DAO ?

2010-12-18 Thread James Carman
Use declarative transaction management instead
 On Dec 18, 2010 10:59 AM, "smallufo"  wrote:
> I am developing a generic CRUD app , that can edit any Spring/JPA entities
> with a AbstractDao pattern's implementation , such as UserDaoImpl ,
> ForumDaoImpl ...etc
>
> In my wicket page : I have to use @SpringBean to identify which
> PlatformTransactionManager to use , such as :
>
> @SpringBean(name="transactionManagerUser")
> private PlatformTransactionManager transactionManagerUser;
> private TransactionTemplate txTemplate;
>
> public CrudPage(final PageParameters pps , final AbstractDao dao)
> {
>
> super(pps);
>
> txTemplate= new TransactionTemplate(transactionManagerUser);
> }
>
> The problem is , these DAOs are using different transaction managers ,
such
> astransactionManagerUser , transactionManagerForum ...etc.
>
> I cannot hard-code these txManager's name in my code. I have to
> programmatically get the dao's txManager . How to achieve that ?
>
> Thanks a lot !
>
> Environments : Spring 3.0.5 , Hibernate-3.6 , JPA2


How to programmatically get PlatformTransactionManager of a DAO ?

2010-12-18 Thread smallufo
I am developing a generic CRUD app , that can edit any Spring/JPA entities
with a AbstractDao pattern's implementation , such as UserDaoImpl ,
ForumDaoImpl ...etc

In my wicket page : I have to use @SpringBean to identify which
PlatformTransactionManager to use , such as :

@SpringBean(name="transactionManagerUser")
private PlatformTransactionManager transactionManagerUser;
private TransactionTemplate txTemplate;

public CrudPage(final PageParameters pps , final AbstractDao dao)
{

  super(pps);

  txTemplate= new TransactionTemplate(transactionManagerUser);
}

 The problem is , these DAOs are using different transaction managers , such
astransactionManagerUser , transactionManagerForum ...etc.

I cannot hard-code these txManager's name in my code. I have to
programmatically get the dao's txManager . How to achieve that ?

Thanks a lot !

Environments : Spring 3.0.5 , Hibernate-3.6 , JPA2