Hi Akalanka/Asitha,

Thanks for the help. Using the name element won't be the best method as per
offline discussion with Asitha.
Since there should be unique jndiConfig's in master-datasources.xml for
each data source, i will search for store configuration data source in
broker.xml and find the relevant jndiConfig in master-datasource. Then use
those data source configurations to configure jdbc driver.

Regards,

On Thu, Feb 12, 2015 at 5:03 PM, Asitha Nanayakkara <asi...@wso2.com> wrote:

> Hi Pumudu
>
> What matters here is the jndiConfig name in each datasource entry. We
> point MB data stores (MessageStore and AndesContextStore) to relevant
> jndiConfig name in broker.xml.
> And we can't have the same jndiConfig name to two different datasource
> entries. Therefore there won't be an issue or relevance in having the same
> name or different names for datasource name
>
> Thanks,
> Asitha
>
> On Thu, Feb 12, 2015 at 3:29 PM, Akalanka Pagoda Arachchi <
> darsha...@wso2.com> wrote:
>
>> Hi Pumudu,
>>
>> You can rename these to any meaningful name. This name is not being used
>> anywhere to retrieve database configurations (jndiConfig is the value which
>> has been used to retrieve configs).
>>
>> Thanks,
>> Akalanka.
>>
>> On Thu, Feb 12, 2015 at 2:43 PM, Pumudu Ruhunage <pum...@wso2.com> wrote:
>>
>>> Hi,
>>>
>>> I'm working on developing dsetup feature in MB. Since all the
>>> datasources are similarly named, it's hard to uniquely identify data source
>>> which needs to be sourced to rdbms store.
>>>
>>> For example,
>>> i need to skip following embedded H2 store configuration.
>>> <!-- WSO2 MB embedded H2 Store     -->
>>>         <datasource>
>>>             <name>*WSO2_MB_STORE_DB*</name>
>>>             <description>The datasource used for registry and user
>>> manager</description>
>>>             <jndiConfig>
>>>                 <name>WSO2MBStoreDB</name>
>>>             </jndiConfig>
>>>             <definition type="RDBMS">
>>>                 <configuration>
>>>
>>> <url>jdbc:h2:repository/database/WSO2MB_DB;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000</url>
>>>                     <driverClassName>org.h2.Driver</driverClassName>
>>>                     <maxActive>50</maxActive>
>>>                     <maxWait>60000</maxWait>
>>>                     <testOnBorrow>true</testOnBorrow>
>>>                     <validationQuery>SELECT 1</validationQuery>
>>>                     <validationInterval>30000</validationInterval>
>>>                 </configuration>
>>>             </definition>
>>>         </datasource>
>>>
>>> And following mssql configurations needs to extract from xml.
>>>        <datasource>
>>>             <name>*WSO2_MB_STORE_DB*</name>
>>>             <jndiConfig>
>>>                 <name>WSO2MBStoreDB</name>
>>>             </jndiConfig>
>>>             <definition type="RDBMS">
>>>             <configuration>
>>>
>>> <url>jdbc:jtds:sqlserver://localhost:1433/wso2_mb</url>
>>>                     <username>root</username>
>>>                     <password>root</password>
>>>
>>> <driverClassName>net.sourceforge.jtds.jdbc.Driver</driverClassName>
>>>                     <maxActive>200</maxActive>
>>>                     <maxWait>60000</maxWait>
>>>                     <minIdle>5</minIdle>
>>>                     <testOnBorrow>true</testOnBorrow>
>>>                     <validationQuery>SELECT 1</validationQuery>
>>>                     <validationInterval>30000</validationInterval>
>>>                 </configuration>
>>>             </definition>
>>>         </datasource>
>>>
>>> It would be great if we can keep two separate names for embedded db
>>> configurations  and external rdbms configurations. For example can we
>>> rename WSO2 MB embedded H2 Store Name to something like 
>>> *WSO2_MB_EMBEDDED_STORE_DB
>>> *?
>>>
>>> Pumudu Ruhunage
>>> Associate Software Engineer | WSO2 Inc
>>> M: +94 779 664493  | http://wso2.com
>>>
>>
>>
>>
>> --
>> *Darshana Akalanka Pagoda Arachchi,*
>> *Software Engineer*
>> *078-4721791*
>>
>
>
>
> --
> *Asitha Nanayakkara*
> Software Engineer
> WSO2, Inc. http://wso2.com/
> Mob: + 94 77 85 30 682
>
>


-- 
Pumudu Ruhunage
Associate Software Engineer | WSO2 Inc
M: +94 779 664493  | http://wso2.com
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to