I could do it work via jmx-console, but I cannot find the way to do it in my
program.
I'm doing:

                DataSourceDelegator dsd = new DataSourceDelegator();
                try{
                        dsd.create();
                        dsd.setBindName("java:/DS1");
                        dsd.setTargetName("java:/DS2");
                } catch (Exception e) {
                        System.out.println("...");
                }

what is wrong in here?


-----Original Message-----
From: Alexey Loubyansky [mailto:[EMAIL PROTECTED]
Sent: Martes, 04 de Noviembre de 2003 03:31 tarde
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-dev] cmp with multiple datasource


It is checked in Branch_3_2.
org.jboss.varia.dsdelegator package.

After building (varia/build.bat), you should find dsdelegator.jar in 
varia/output/lib. It should be copiied to server/<config-name>/lib.
In varia/src/resources/services/dsdelegator you can find a sample config 
dsdelegator-service.xml

Sorry, for the delay.

[EMAIL PROTECTED] wrote:

> Yes please, I´ll be very thankful if you commit it!!!
> 
> 
> -----Original Message-----
> From: Alexey Loubyansky [mailto:[EMAIL PROTECTED]
> Sent: Lunes, 03 de Noviembre de 2003 06:46 mañana
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-dev] cmp with multiple datasource
> 
> 
> I went another way and wrote a datasource delegator service. It is very 
> simple. The service implements DataSource interface and has a method 
> that sets the target DataSource. The service is bound into the JNDI. All 
> you need to do is just to specify this service instead of a real 
> DataSource for your entity beans and change the target at runtime.
> 
> I could commit it in org.jboss.varia.* if there is an interest in it.
> 
> [EMAIL PROTECTED] wrote:
> 
>>Alexey, first of all, thanks for your response.
>>When do you think you will add this support?
>>
>>Regards,
>>Hernán.
>>
>>-----Original Message-----
>>From: Hernan Terzian 
>>Sent: Viernes, 31 de Octubre de 2003 09:39 mañana
>>To: '[EMAIL PROTECTED]'
>>Subject: RE: [JBoss-dev] cmp with multiple datasource
>>
>>
>>Yes!!! It would be great !!!
>>
>>-----Original Message-----
>>From: Alexey Loubyansky [mailto:[EMAIL PROTECTED]
>>Sent: Viernes, 31 de Octubre de 2003 07:47 mañana
>>To: [EMAIL PROTECTED]
>>Subject: Re: [JBoss-dev] cmp with multiple datasource
>>
>>
>>We could add support for chaging entity bean's datasource at runtime 
>>only in case when the datasources have the same type mappings 
>>(datasource-mapping) and database schemas are the same. Would it help you?
>>
>>[EMAIL PROTECTED] wrote:
>>
>>
>>
>>>this is my scenario:
>>>     we need to migrate an old application that have 5 different
>>>implementations, so when a user log into the application, it is
redirected
>>>to his respective server. In each server is running the same data model
>>
>>but
>>
>>
>>>with different data.
>>>
>>>Now, we are migrating this old app (client/server) to web but we cannot
>>>change the data model (damn customer issue), so I´m trying to not
>>
>>construct
>>
>>
>>>different EJBs to each datasource.
>>>
>>>The meanwhile workaround is to create a new jar for each implementation
>>
>>(the
>>
>>
>>>same code, but with different jndi names and datasources), but it
>>
>>represents
>>
>>
>>>a heavy maintenance code...
>>>
>>>Any ideas?
>>>
>>>-----Original Message-----
>>>From: Alexey Loubyansky [mailto:[EMAIL PROTECTED]
>>>Sent: Jueves, 30 de Octubre de 2003 05:20 tarde
>>>To: [EMAIL PROTECTED]
>>>Subject: Re: [JBoss-dev] cmp with multiple datasource
>>>
>>>
>>>No way, at the moment. But could you tell why you would like to do it?
>>>Thanks.
>>>
>>>[EMAIL PROTECTED] wrote:
>>>
>>>
>>>
>>>
>>>>Hi all,
>>>>    does anybody know how can I change the CMP entity bean datasource on
>>>>runtime? 
>>>>    Are there any workaround to get this?
>>>>
>>>>Regards,
>>>>Hernán.
>>>>
>>>>
>>>>-------------------------------------------------------
>>>>This SF.net email is sponsored by: SF.net Giveback Program.
>>>>Does SourceForge.net help you be more productive?  Does it
>>>>help you create better code?   SHARE THE LOVE, and help us help
>>>>YOU!  Click Here: http://sourceforge.net/donate/
>>>>_______________________________________________
>>>>JBoss-Development mailing list
>>>>[EMAIL PROTECTED]
>>>>https://lists.sourceforge.net/lists/listinfo/jboss-development
>>>>
>>>
>>>
>>>
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.net email is sponsored by: SF.net Giveback Program.
>>>Does SourceForge.net help you be more productive?  Does it
>>>help you create better code?   SHARE THE LOVE, and help us help
>>>YOU!  Click Here: http://sourceforge.net/donate/
>>>_______________________________________________
>>>JBoss-Development mailing list
>>>[EMAIL PROTECTED]
>>>https://lists.sourceforge.net/lists/listinfo/jboss-development
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.net email is sponsored by: SF.net Giveback Program.
>>>Does SourceForge.net help you be more productive?  Does it
>>>help you create better code?   SHARE THE LOVE, and help us help
>>>YOU!  Click Here: http://sourceforge.net/donate/
>>>_______________________________________________
>>>JBoss-Development mailing list
>>>[EMAIL PROTECTED]
>>>https://lists.sourceforge.net/lists/listinfo/jboss-development
>>>
>>
>>
>>
>>
>>
>>-------------------------------------------------------
>>This SF.net email is sponsored by: SF.net Giveback Program.
>>Does SourceForge.net help you be more productive?  Does it
>>help you create better code?   SHARE THE LOVE, and help us help
>>YOU!  Click Here: http://sourceforge.net/donate/
>>_______________________________________________
>>JBoss-Development mailing list
>>[EMAIL PROTECTED]
>>https://lists.sourceforge.net/lists/listinfo/jboss-development
>>
>>
>>-------------------------------------------------------
>>This SF.net email is sponsored by: SF.net Giveback Program.
>>Does SourceForge.net help you be more productive?  Does it
>>help you create better code?   SHARE THE LOVE, and help us help
>>YOU!  Click Here: http://sourceforge.net/donate/
>>_______________________________________________
>>JBoss-Development mailing list
>>[EMAIL PROTECTED]
>>https://lists.sourceforge.net/lists/listinfo/jboss-development
>>
> 
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive?  Does it
> help you create better code?   SHARE THE LOVE, and help us help
> YOU!  Click Here: http://sourceforge.net/donate/
> _______________________________________________
> JBoss-Development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive?  Does it
> help you create better code?   SHARE THE LOVE, and help us help
> YOU!  Click Here: http://sourceforge.net/donate/
> _______________________________________________
> JBoss-Development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to