You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Kristina (JIRA)" <tu...@ws.apache.org> on 2007/12/05 10:25:43 UTC

[jira] Created: (TUSCANY-1929) when query does not include only pk , java.lang.RuntimeException is returned

when query does not include only pk , java.lang.RuntimeException is returned
----------------------------------------------------------------------------

                 Key: TUSCANY-1929
                 URL: https://issues.apache.org/jira/browse/TUSCANY-1929
             Project: Tuscany
          Issue Type: Bug
          Components: Java DAS RDB
    Affects Versions: Java-DAS-M2
         Environment: java ee 1.5, eclipse 3.3.1.1. , windows xp, das 1.0 beta 2, access mdb - no access installed, sca 1.0
            Reporter: Kristina 


hi all,
not sure if this is a bug or is just me... bottom line i need help :)

i am trying to use das to read data from an access mdb into an dataobject (sdo)
DAS das = DAS.FACTORY.createDAS(con);
String sql = "select * from [" + tablename+ "] ;
Command readTableData = das.createCommand(sql);
DataObject root = readTableData.executeQuery();

when trying to run the code above, i get 
Table WD Peripheral HD Controller in query does not include Primary Key column or has null value in it, can not proceed!

same error if i set the pk using ConfigHelper.addprimarykey(pk)
same error if the sql string contains all fields from the table, pk included

******************** error message **************************

java.lang.RuntimeException: Table WD Peripheral HD Controller in query does not include Primary Key column or has null value in it, can not proceed!
	at org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.addRowToGraph(ResultSetProcessor.java:117)
	at org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResultSet(ResultSetProcessor.java:91)
	at org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResults(ResultSetProcessor.java:77)
	at org.apache.tuscany.das.rdb.impl.ReadCommandImpl.buildGraph(ReadCommandImpl.java:309)
	at org.apache.tuscany.das.rdb.impl.ReadCommandImpl.executeQuery(ReadCommandImpl.java:277)

******************* end error message *******************

if the sql string looks like this: String sql = "select " + pk + " from [" + tablename+ "] "; i get no error message but when trying to generate the xml from dataobject root, i get an empty one.
String generatedXml = XMLHelper.INSTANCE.save(root, "http://helloworld2", "MaterialListForTest");

what am i doing wrong?

thanks,

kristina

-- 
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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-1929) generate xml from dataobject

Posted by "David T. Adcox (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David T. Adcox updated TUSCANY-1929:
------------------------------------

    Attachment: XMLHelperSample.java

Here is a sample of the XMLHelper generating an instance XML.

> generate xml from dataobject
> ----------------------------
>
>                 Key: TUSCANY-1929
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1929
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java DAS RDB
>    Affects Versions: Java-DAS-M2
>         Environment: java ee 1.5, eclipse 3.3.1.1. , windows xp, das 1.0 beta 2, access mdb - no access installed, sca 1.0
>            Reporter: Kristina 
>         Attachments: XMLHelperSample.java
>
>
> hi all,
> not sure if this is a bug or is just me... bottom line i need help :)
> when trying to generate the xml from dataobject , i get an empty one eventhough the dataobject is filled
> I am using: String generatedXml = XMLHelper.INSTANCE.save(root, "http://helloworld2", "MaterialListForTest"); where root is my dataobject
> what am i doing wrong?
> thanks,
> kristina

-- 
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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-1929) generate xml from dataobject

Posted by "Kristina (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristina  updated TUSCANY-1929:
-------------------------------

    Description: 
hi all,
not sure if this is a bug or is just me... bottom line i need help :)

when trying to generate the xml from dataobject , i get an empty one eventhough the dataobject is filled
I am using: String generatedXml = XMLHelper.INSTANCE.save(root, "http://helloworld2", "MaterialListForTest"); where root is my dataobject

what am i doing wrong?

thanks,

kristina

  was:
hi all,
not sure if this is a bug or is just me... bottom line i need help :)

i am trying to use das to read data from an access mdb into an dataobject (sdo)
DAS das = DAS.FACTORY.createDAS(con);
String sql = "select * from [" + tablename+ "] ;
Command readTableData = das.createCommand(sql);
DataObject root = readTableData.executeQuery();

when trying to run the code above, i get 
Table WD Peripheral HD Controller in query does not include Primary Key column or has null value in it, can not proceed!

same error if i set the pk using ConfigHelper.addprimarykey(pk)
same error if the sql string contains all fields from the table, pk included

******************** error message **************************

java.lang.RuntimeException: Table WD Peripheral HD Controller in query does not include Primary Key column or has null value in it, can not proceed!
	at org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.addRowToGraph(ResultSetProcessor.java:117)
	at org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResultSet(ResultSetProcessor.java:91)
	at org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResults(ResultSetProcessor.java:77)
	at org.apache.tuscany.das.rdb.impl.ReadCommandImpl.buildGraph(ReadCommandImpl.java:309)
	at org.apache.tuscany.das.rdb.impl.ReadCommandImpl.executeQuery(ReadCommandImpl.java:277)

******************* end error message *******************

if the sql string looks like this: String sql = "select " + pk + " from [" + tablename+ "] "; i get no error message but when trying to generate the xml from dataobject root, i get an empty one.
String generatedXml = XMLHelper.INSTANCE.save(root, "http://helloworld2", "MaterialListForTest");

what am i doing wrong?

thanks,

kristina

        Summary: generate xml from dataobject  (was: when query does not include only pk , java.lang.RuntimeException is returned)

> generate xml from dataobject
> ----------------------------
>
>                 Key: TUSCANY-1929
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1929
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java DAS RDB
>    Affects Versions: Java-DAS-M2
>         Environment: java ee 1.5, eclipse 3.3.1.1. , windows xp, das 1.0 beta 2, access mdb - no access installed, sca 1.0
>            Reporter: Kristina 
>
> hi all,
> not sure if this is a bug or is just me... bottom line i need help :)
> when trying to generate the xml from dataobject , i get an empty one eventhough the dataobject is filled
> I am using: String generatedXml = XMLHelper.INSTANCE.save(root, "http://helloworld2", "MaterialListForTest"); where root is my dataobject
> what am i doing wrong?
> thanks,
> kristina

-- 
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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1929) generate xml from dataobject

Posted by "Amita Vadhavkar (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549483 ] 

Amita Vadhavkar commented on TUSCANY-1929:
------------------------------------------

Based on the below comments, some reasons for getting the RuntimeException -

1) if the table has some rows where value of PK column has  null value,
please see if the query like - "select * from tablename where pkname is not null "- also gives same exception
or if the XMLHelper can print correct graph of all rows from table where pk does not have null value

2) if ConfigHelper.addPrimaryKey(columnName)  does not contain qualified columname. (this will result in another exception - java.lang.RuntimeException: Column CUSTID must be qualified with a table name and optional schema name
	at org.apache.tuscany.das.rdb.config.wrapper.QualifiedColumn.<init>(QualifiedColumn.java:51)
	at org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper.addPrimaryKey(MappingWrapper.java:348)
	at org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper.addPrimaryKey(MappingWrapper.java:334)
	at org.apache.tuscany.das.rdb.ConfigHelper.addPrimaryKey(ConfigHelper.java:81)
)

e.g. please see below - 
    	ConfigHelper cfgHelper = new ConfigHelper();

       //below needs to be tableName.columnName or in case of multiple schema support turned ON, schemaName.tableName,columnName
    	cfgHelper.addPrimaryKey("CUSTOMER.CUSTID"); 

    	DAS das = DAS.FACTORY.createDAS(getConnection());
    	Command select = das.createCommand("select CUSTID/* from customer");
    	DataObject root = select.executeQuery();
    	System.out.println(XMLHelper.INSTANCE.save(root, "root", "root"));

>From the description below, it looks like most probable cause is 1). In case of 1) the reason for this exception is -
when the rows are fetched from db where some PK columns have null, conversion to SDO is not possible as 
uniqueness of SDO instances (one per row) can be guaranteed only with unique PK values.  

--------------------------------------------------------------------------------------------------------------------------------
when query does not include only pk , java.lang.RuntimeException is returned

i am trying to use das to read data from an access mdb into an dataobject (sdo)
DAS das = DAS.FACTORY.createDAS(con);
String sql = "select * from [" + tablename+ "] ;
Command readTableData = das.createCommand(sql);
DataObject root = readTableData.executeQuery();

when trying to run the code above, i get
Table WD Peripheral HD Controller in query does not include Primary Key column or has null value in it, can not proceed!

same error if i set the pk using ConfigHelper.addprimarykey(pk)
same error if the sql string contains all fields from the table, pk included

> generate xml from dataobject
> ----------------------------
>
>                 Key: TUSCANY-1929
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1929
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java DAS RDB
>    Affects Versions: Java-DAS-M2
>         Environment: java ee 1.5, eclipse 3.3.1.1. , windows xp, das 1.0 beta 2, access mdb - no access installed, sca 1.0
>            Reporter: Kristina 
>            Assignee: Amita Vadhavkar
>         Attachments: XMLHelperSample.java
>
>
> hi all,
> not sure if this is a bug or is just me... bottom line i need help :)
> when trying to generate the xml from dataobject , i get an empty one eventhough the dataobject is filled
> I am using: String generatedXml = XMLHelper.INSTANCE.save(root, "http://helloworld2", "MaterialListForTest"); where root is my dataobject
> what am i doing wrong?
> thanks,
> kristina

-- 
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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Closed: (TUSCANY-1929) generate xml from dataobject

Posted by "Amita Vadhavkar (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amita Vadhavkar closed TUSCANY-1929.
------------------------------------

    Resolution: Fixed

In case the prevision explanation is not applicable to the problem , please re-open the issue.

> generate xml from dataobject
> ----------------------------
>
>                 Key: TUSCANY-1929
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1929
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java DAS RDB
>    Affects Versions: Java-DAS-M2
>         Environment: java ee 1.5, eclipse 3.3.1.1. , windows xp, das 1.0 beta 2, access mdb - no access installed, sca 1.0
>            Reporter: Kristina 
>            Assignee: Amita Vadhavkar
>         Attachments: XMLHelperSample.java
>
>
> hi all,
> not sure if this is a bug or is just me... bottom line i need help :)
> when trying to generate the xml from dataobject , i get an empty one eventhough the dataobject is filled
> I am using: String generatedXml = XMLHelper.INSTANCE.save(root, "http://helloworld2", "MaterialListForTest"); where root is my dataobject
> what am i doing wrong?
> thanks,
> kristina

-- 
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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Assigned: (TUSCANY-1929) generate xml from dataobject

Posted by "Amita Vadhavkar (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amita Vadhavkar reassigned TUSCANY-1929:
----------------------------------------

    Assignee: Amita Vadhavkar

> generate xml from dataobject
> ----------------------------
>
>                 Key: TUSCANY-1929
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1929
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java DAS RDB
>    Affects Versions: Java-DAS-M2
>         Environment: java ee 1.5, eclipse 3.3.1.1. , windows xp, das 1.0 beta 2, access mdb - no access installed, sca 1.0
>            Reporter: Kristina 
>            Assignee: Amita Vadhavkar
>         Attachments: XMLHelperSample.java
>
>
> hi all,
> not sure if this is a bug or is just me... bottom line i need help :)
> when trying to generate the xml from dataobject , i get an empty one eventhough the dataobject is filled
> I am using: String generatedXml = XMLHelper.INSTANCE.save(root, "http://helloworld2", "MaterialListForTest"); where root is my dataobject
> what am i doing wrong?
> thanks,
> kristina

-- 
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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1929) generate xml from dataobject

Posted by "David T. Adcox (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548803 ] 

David T. Adcox commented on TUSCANY-1929:
-----------------------------------------

Kristina,

One thing that is not clear is whether or not you are getting 'anything' returned in the 'generatedXml' variable.  I would expect to see some contents.  If you are getting something from the call, could you attach what you are seeing, to this JIRA?

I will post a simple sample of the XMLHelper class doing what you are attempting to do in the code above.  My sample will generate a type, create an instance of that type, then display the contents of the instance in both XML and from  the data object directly.  The DO dump is a very abbreviated version of what you can find demonstrated in the org.apache.tuscany.samples.sdo.advanced.PrintDataGraph sample found in sample-sdo porject. 

> generate xml from dataobject
> ----------------------------
>
>                 Key: TUSCANY-1929
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1929
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java DAS RDB
>    Affects Versions: Java-DAS-M2
>         Environment: java ee 1.5, eclipse 3.3.1.1. , windows xp, das 1.0 beta 2, access mdb - no access installed, sca 1.0
>            Reporter: Kristina 
>
> hi all,
> not sure if this is a bug or is just me... bottom line i need help :)
> when trying to generate the xml from dataobject , i get an empty one eventhough the dataobject is filled
> I am using: String generatedXml = XMLHelper.INSTANCE.save(root, "http://helloworld2", "MaterialListForTest"); where root is my dataobject
> what am i doing wrong?
> thanks,
> kristina

-- 
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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org