multiple datasource for the same mapper?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

multiple datasource for the same mapper?

nino martinez wael
Hi

I have a situation where we sometimes need to use one db for lookup and sometimes the other db depending if fail over has been activated. I've seen the post that Simone did about multiple datasource for different mappers but it of course does not mention a context for mappers. OR could I just implement this in the datasourceprovider..? I think that actually may be the way to go..

Input & ideas always appreciated

regards Nino
Reply | Threaded
Open this post in threaded view
|

Re: multiple datasource for the same mapper?

Simone Tripodi
Hi Nino :)
I still haven't had the time to give some tries, but did you already
try with BindingAnnotations?
Let me know!!!
All the best,
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Thu, Oct 14, 2010 at 7:49 PM, nino martinez wael
<[hidden email]> wrote:
> Hi
> I have a situation where we sometimes need to use one db for lookup and
> sometimes the other db depending if fail over has been activated. I've seen
> the post that Simone did about multiple datasource for different mappers but
> it of course does not mention a context for mappers. OR could I just
> implement this in the datasourceprovider..? I think that actually may be the
> way to go..
> Input & ideas always appreciated
> regards Nino
Reply | Threaded
Open this post in threaded view
|

RE: multiple datasource for the same mapper?

Poitras Christian
Hi Simo,

The problem with having 2 datasources is that the bindings made by MyBatis-Guice are not linked to an annotation. So it becomes impossible to expose such bindings in a private module - unless there is only one private module.
You could probably change the plugin to take an optional annotation to which all bindings would be linked - possibly in addition to non-annotation bindings.

Christian

-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]] De la part de Simone Tripodi
Envoyé : October-14-10 2:02 PM
À : [hidden email]
Objet : Re: multiple datasource for the same mapper?

Hi Nino :)
I still haven't had the time to give some tries, but did you already
try with BindingAnnotations?
Let me know!!!
All the best,
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Thu, Oct 14, 2010 at 7:49 PM, nino martinez wael
<[hidden email]> wrote:
> Hi
> I have a situation where we sometimes need to use one db for lookup and
> sometimes the other db depending if fail over has been activated. I've seen
> the post that Simone did about multiple datasource for different mappers but
> it of course does not mention a context for mappers. OR could I just
> implement this in the datasourceprovider..? I think that actually may be the
> way to go..
> Input & ideas always appreciated
> regards Nino
Reply | Threaded
Open this post in threaded view
|

Re: multiple datasource for the same mapper?

Simone Tripodi
Hi Christian,
indeed, sorry for the terrible mistake :( Looking forward to think a
better solution,
All the best and thanks for the feedbacks,
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Thu, Oct 14, 2010 at 8:08 PM, Poitras Christian
<[hidden email]> wrote:

> Hi Simo,
>
> The problem with having 2 datasources is that the bindings made by MyBatis-Guice are not linked to an annotation. So it becomes impossible to expose such bindings in a private module - unless there is only one private module.
> You could probably change the plugin to take an optional annotation to which all bindings would be linked - possibly in addition to non-annotation bindings.
>
> Christian
>
> -----Message d'origine-----
> De : [hidden email] [mailto:[hidden email]] De la part de Simone Tripodi
> Envoyé : October-14-10 2:02 PM
> À : [hidden email]
> Objet : Re: multiple datasource for the same mapper?
>
> Hi Nino :)
> I still haven't had the time to give some tries, but did you already
> try with BindingAnnotations?
> Let me know!!!
> All the best,
> Simo
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
>
>
> On Thu, Oct 14, 2010 at 7:49 PM, nino martinez wael
> <[hidden email]> wrote:
>> Hi
>> I have a situation where we sometimes need to use one db for lookup and
>> sometimes the other db depending if fail over has been activated. I've seen
>> the post that Simone did about multiple datasource for different mappers but
>> it of course does not mention a context for mappers. OR could I just
>> implement this in the datasourceprovider..? I think that actually may be the
>> way to go..
>> Input & ideas always appreciated
>> regards Nino
>