[ 
https://issues.apache.org/jira/browse/TUSCANY-1381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Amita Vadhavkar updated TUSCANY-1381:
-------------------------------------

    Attachment: workingExampleJune26.jar

Tried the original config.xml you have provided with a few minor changes
and it worked with latest RDB DAS. I am not sure why M2 has problems
But if possible please see if you can take the latest code from 
(trunk) https://svn.apache.org/repos/asf/incubator/tuscany/java/das
as DAS has come a long way after M2. I would like to help in case
there are any problems in using code to build RDB DAS.

I did try your config.xml in the new J2SE Sample available in trunk.
I am trying to attach the 2 changed/added files from das\samples\customer (J2SE 
sample)
(1-config.xml , 2-Caller program to use this config.xml-CustomerClient.java) 
and it worked fine.

In this latest code from trunk, there are a bunch of new features implemented,
on their way to get released, like below. Would you like to try these too?

*DAS uses overqualified update by default
Currently in the DAS we either use a user-defined version column or do not use 
any concurrency control. We have enough information to build an overqualified 
update in cases where a version column is not defined. For example, if a field 
"name" is changed from "Bob" to "John", we would generate a query such as:
UPDATE CUSTOMER SET NAME = 'John' WHERE ID = 1 AND NAME = 'Bob'
If the statement does not update any rows in the database, the DAS will throw a 
concurrency control exception. 
This scheme will not work in case of LONG VARCHAR, BLOB, or CLOB columns, so an 
exception should be thrown in that case indicating that a version column must 
be defined. 

*DAS Configuration supports ConnectionInfo for J2SE environment
So far the DAS allowed users to specify a JDBC Connection for the DAS to 
utilize by either providing a JDBC Connection explicitly or providing a JNDI 
name in the config file. Now DAS supports DriverManager info to be provided to 
allow similar, config-based set up, in a J2SE environment.

*Creation and initialization of database for DAS samples
So far, the DAS samples provided canned database with them. This feature is an 
useful utility which supports an external configuration based creation and 
initialization of database when sample is loaded for the first time. User can 
design the database schema using the external configuration.

*DAS supports queries that reference tables in multiple schema
So far DAS did not support multiple database schema. This feature allows DAS to 
execute all commands for tables in different schema.

*Advanced DAS features Demo
This is not a new feature in itself but a new sample demonstrating multiple 
advanced features in DAS like optimistic concurrency control, column converter, 
result set shape...New features will keep getting added to this in future.


> DAS config file with default namespace will not work
> ----------------------------------------------------
>
>                 Key: TUSCANY-1381
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1381
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java DAS RDB
>    Affects Versions: Java-DAS-M2
>            Reporter: wangful
>         Attachments: workingExampleJune26.jar
>
>
> Hi, 
> If I use the following xml file as the DAS config file, there will be errors:
> DAS das = 
> DAS.FACTORY.createDAS(Thread.currentThread().getContextClassLoader().getResourceAsStream("config.xml"),
>  conn);
> <Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd";>
>       <Command name="AllCustomers" SQL="select * from MYCUSTOMER" 
> kind="Select">
>       <ResultDescriptor columnName="ID" tableName="MYCUSTOMER" 
> columnType="commonj.sdo.Long"/>
>       <ResultDescriptor columnName="Name" tableName="MYCUSTOMER" 
> columnType="commonj.sdo.String"/>
>       </Command>
>       
>       <Table tableName="MYCUSTOMER">
>               <Column columnName="ID" primaryKey="true" />
>               <Column columnName="NAME" />
>       </Table>
>       
> </Config>
> The error is: 
> Exception in thread "main" java.lang.RuntimeException: 
> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'Command' 
> not found. (http:///temp.xml, 25, 76)
>       at 
> org.apache.tuscany.das.rdb.util.ConfigUtil.loadConfig(ConfigUtil.java:54)
>       at org.apache.tuscany.das.rdb.impl.DASImpl.<init>(DASImpl.java:100)
>       at 
> org.apache.tuscany.das.rdb.impl.DASFactoryImpl.createDAS(DASFactoryImpl.java:39)
>       at TestDAS.main(TestDAS.java:52)
> It seems the default namespace can't work.  But if I add prefix for the 
> namespace as below, it will work.
> <c:Config xmlns:c="http:///org.apache.tuscany.das.rdb/config.xsd";>
>       <Command name="AllCustomers" SQL="select * from MYCUSTOMER" 
> kind="Select">
>       <ResultDescriptor columnName="ID" tableName="MYCUSTOMER" 
> columnType="commonj.sdo.Long"/>
>       <ResultDescriptor columnName="Name" tableName="MYCUSTOMER" 
> columnType="commonj.sdo.String"/>
>       </Command>
>       
>       <Table tableName="MYCUSTOMER">
>               <Column columnName="ID" primaryKey="true" />
>               <Column columnName="NAME" />
>       </Table>
>       
> </c:Config>
> From the user manual and samples, I think we need not supply the prefix for 
> the namespace. But it can't work in my eclipse. 
> Can someone help to make the default namespace work? 
> Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to