Hi all,
I came through the problem above. So after lot of debugging I managed to
make it work with following changes.

1. Change the sample dataservice as below
change
        <property name="carbon_datasource_name">TestDS</property>
to
        <property name="jndi_resource_name">jdbc/TestDS</property>

2. Change DB deployer to set application name to carbon context at the
start of deployment and remove it at the end. Diff is attached.

So I can go ahead with first change in AF side. But we need the second
change in AS/DSS side to make this work. So can we add this to DBDeployer.

I guess we need this in all service deployers. AFAIK we already have this
in webapp deployers.

WDYT?


Thanks & Regards
Danushka Fernando
Software Engineer
WSO2 inc. http://wso2.com/
Mobile : +94716332729
Index: 
org.wso2.carbon.dataservices.core/4.2.1/src/main/java/org/wso2/carbon/dataservices/core/DBDeployer.java
===================================================================
--- 
org.wso2.carbon.dataservices.core/4.2.1/src/main/java/org/wso2/carbon/dataservices/core/DBDeployer.java
     (revision 204457)
+++ 
org.wso2.carbon.dataservices.core/4.2.1/src/main/java/org/wso2/carbon/dataservices/core/DBDeployer.java
     (working copy)
@@ -125,6 +125,7 @@
         */
        public void deploy(DeploymentFileData deploymentFileData)
                        throws DeploymentException {
+               
PrivilegedCarbonContext.getThreadLocalCarbonContext().setApplicationName(deploymentFileData.getName());
                try {
             RealmService realmService = 
DataServicesDSComponent.getRealmService();
             if (realmService != null) {
@@ -234,6 +235,7 @@
                 } catch (Exception e) {
                     log.error("Cannot register faulty service with Carbon", e);
                 }
+                               
PrivilegedCarbonContext.getThreadLocalCarbonContext().setApplicationName(null);
                        }
                }
        }
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to