tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashok Shah <ashok.s...@gmail.com>
Subject Problem modifying data with DAS service for Oracle database.
Date Wed, 17 Jun 2009 02:08:18 GMT
Hello,
I am trying some basic examples for Tuscany SDO DAS implementation.
Below is my configuration file:
<?xml version="1.0" encoding="ASCII"?>
 <Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd">

 <ConnectionInfo>
  <ConnectionProperties
  driverClass="oracle.jdbc.driver.OracleDriver"
  databaseURL="jdbc:oracle:thin:@xxx:xxx:xxx"
  userName="xxxxx" password="xxxxx" />
 </ConnectionInfo>


  <Command name="AllTablea" SQL="select * from TABLEA" kind="Select" >
  <ResultDescriptor columnName="COLUMNA" tableName="TABLEA"
  columnType="commonj.sdo.Decimal"/>
  <ResultDescriptor columnName="COLUMNB" tableName="TABLEA"
  columnType="commonj.sdo.String"/>
  <ResultDescriptor columnName="COLUMNC" tableName="TABLEA"
  columnType="commonj.sdo.String"/>
  </Command>

  <Table tableName="TABLEA">
  <Column columnName="COLUMNA" primaryKey="true"/>
  <Column columnName="COLUMNB" />
  <Column columnName="COLUMBC" />
  </Table>
</Config>
When I try to fetch the rows, it returns without any error, but when i try
to modify any data it throws an exception.
The code that modifies the data:
public final void changeColumnb() {
  Command readAll = this.getDAS().getCommand("AllTablea");
  DataObject root = readAll.executeQuery();
  DataObject firstCustomer = root.getDataObject("TABLEA[1]");
  System.out.println(firstCustomer.getString("COLUMNB"));
  firstCustomer.setString("COLUMNB", "BlueBerry");
  das.applyChanges(root);
  }
The Table description for TABLEA:
COLUMNA --> Type NUMBER(10)
COLUMNB --> Type VARCHAR(30)
COLUMNC --> Type VARCHAR(30)
The Error:
  [java] Exception in thread "main" java.lang.RuntimeException: Not a valid
SDO Type org.apache.t
uscany.sdo.impl.DataTypeImpl@111b910 (name: Decimal) (instanceClassName:
java.math.BigDecimal) (seri
alizable: true)
  [java] at
org.apache.tuscany.das.rdb.impl.SDODataTypeHelper.columnTypeForSDOType(SDODataTyp
eHelper.java:105)
  [java] at
org.apache.tuscany.das.rdb.generator.impl.InsertGenerator.getInsertCommand(Insert
Generator.java:116)
  [java] at
org.apache.tuscany.das.rdb.impl.ChangeFactory.getCreateCommand(ChangeFactory.java
:102)
  [java] at
org.apache.tuscany.das.rdb.impl.ChangeFactory.createInsertOperation(ChangeFactory
.java:81)
  [java] at
org.apache.tuscany.das.rdb.impl.ChangeSummarizer.createChange(ChangeSummarizer.ja
va:96)
  [java] at
org.apache.tuscany.das.rdb.impl.ChangeSummarizer.loadChanges(ChangeSummarizer.jav
a:80)
  [java] at
org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl.execute(ApplyChangesComma
ndImpl.java:64)
  [java] at
org.apache.tuscany.das.rdb.impl.DASImpl.applyChanges(DASImpl.java:310)
  [java] at com.syscon.sdo.Main.changeColumnb(Unknown Source)
  [java] at com.syscon.sdo.Main.main(Unknown Source)
  [java] Java Result: 1
Thanks,
Ashok.

Mime
View raw message