Re: [DAS] Unit Tests as samples, was Fwd: [jira] Commented: (TUSCANY-952) DAS must support queries that reference tables in different schemas

2007-04-27 Thread Amita Vadhavkar

Hi,
I have submitted 2 patches on 26th Apr.
One is the rdb - das and other for DB2 sample. The readme in the sample can
be
reviewed to check completeness of test cases.

I am working on changing the unit test framework to accomodate the same
It will use Derby, will have 3 new schemas and 9 new tables and 3 new
configs
and 14 (current number of test cases) new cases in one class.
I will submit this patch today (27th Apr).

Meanwhile if there are some suggestions on the code or test cases, please
let me
know , so I can accomodate same .

Regards,
Amita

On 4/25/07, Luciano Resende [EMAIL PROTECTED] wrote:


Hi

4) As mentioned during last patch submission,  work-in-progress for a
J2SE
test client having the test cases
mentioned in the documentation. It will be there in the next patch along
with issue resolution for 2) and 3).
The unit test cases are not added to the rdb core test suite as, the
current unit tests' db ,
table creation - does not support the multi-schema condition, and instead
of scattering many new
 tables,scema, classes in the unit tests, same test cases will be shown
using a separate J2SE test client
 sample. For unit testing, this sample can be modified and tested.

How do you plan to automate the tests around this, if you use a J2SE
sample
instead of JUnit ?
How difficult would be to extend the current unit tests database framework
to support the TUSCANY-952 requirements?


-- Forwarded message --
From: Amita Vadhavkar (JIRA) tuscany-dev@ws.apache.org
Date: Apr 25, 2007 5:06 AM
Subject: [jira] Commented: (TUSCANY-952) DAS must support queries that
reference tables in different schemas
To: tuscany-dev@ws.apache.org


   [

https://issues.apache.org/jira/browse/TUSCANY-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491618
]

Amita Vadhavkar commented on TUSCANY-952:
-

1)For the first issue regarding QualifiedColumn constructor:-
QualifiedColumn(String name, boolean isDatabaseSchemaNameSupported), below
is the explaination:-

In QualifiesColumn - what is expected in name parameter is
tableName.columnName - at the least.

When multiple schema support is ON, the name parameter is expected to have
schemaName.tableName.columnName.

So in both the cases tableName.columnName is the minimum requirement. Thus
invoking the
constructor like QualifiedColumn(table, false) does not follow the
minimum
requirement,
because irrespective of multi-schema support, at least one '.' needs to be
there in 'name'.

With this the current logic in the code looks OK, if it throws
RuntimeException for
new QualifiedColumn(table, false)

2) For second issue regarding
MappingWrapper.addRelationship(Vector, Vector) -
work-in-progress

3) addConverter(String name, String converter) - the existing code will as
such work correct, as
findOrCreateTable(column) is using QualifiedColumn which has schemaName
information as a member
variable.
Still, will clean code and will add more comments.

4) As mentioned during last patch submission,  work-in-progress for a J2SE
test client having the test cases
mentioned in the documentation. It will be there in the next patch along
with issue resolution for 2) and 3).
The unit test cases are not added to the rdb core test suite as, the
current
unit tests' db , table creation - does
not support the multi-schema condition, and instead of scattering many new
tables,scema, classes in the unit tests, same test cases will be shown
using
a separate J2SE test client sample. For unit testing, this sample can be
modified and tested.

 DAS must support queries that reference tables in different schemas
 -

 Key: TUSCANY-952
 URL: https://issues.apache.org/jira/browse/TUSCANY-952
 Project: Tuscany
  Issue Type: Bug
  Components: Java DAS RDB
Reporter: Kevin Williams
 Fix For: Java-DAS-Mx

 Attachments: DAS-JIRA-952-Apr24-Amita.txt, JIRA-952-Details.doc,
JIRA-952-Feb16-Amita.jar, JIRA-952-Mar01-Amita.jar


 The DAS is curently ignorant of database schema designations.  This
means
the DAS will generate incorrect write statements when it processes the
change summary from a data graph that originated from a query that uses
schema names that are different from the default schema.

--
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]



--
Luciano Resende
http://people.apache.org/~lresende



Re: [DAS] Unit Tests as samples, was Fwd: [jira] Commented: (TUSCANY-952) DAS must support queries that reference tables in different schemas

2007-04-27 Thread Amita Vadhavkar

Hi,
files in patch for test cases:-
old*DatabaseSetup
new*MultiSchemaData
new*MultiSchemaTests
old*AllCommonTests
new*AllTestsDerbyMultiSchema
old*rdb-das pom.xml
new*2 configs

Problem:
When added to AllCommonTests or in a separate AllTestsDerbyMultiSchema (pom
changed to invoke this)
getting OutOfMemory - like below.
testMultiSchemaCase14(org.apache.tuscany.das.rdb.test.MultiSchemaTests)
Time el
apsed: 1.382 sec   ERROR!
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space

When the same is run under junit in eclipse, all tests run fine.

Please let me know if there is a solution.

Regards,
Amita


On 4/27/07, Amita Vadhavkar [EMAIL PROTECTED] wrote:


Hi,
I have submitted 2 patches on 26th Apr.
One is the rdb - das and other for DB2 sample. The readme in the sample
can be
reviewed to check completeness of test cases.

I am working on changing the unit test framework to accomodate the same
It will use Derby, will have 3 new schemas and 9 new tables and 3 new
configs
 and 14 (current number of test cases) new cases in one class.
I will submit this patch today (27th Apr).

Meanwhile if there are some suggestions on the code or test cases, please
let me
know , so I can accomodate same .

Regards,
Amita

 On 4/25/07, Luciano Resende [EMAIL PROTECTED] wrote:

 Hi

 4) As mentioned during last patch submission,  work-in-progress for a
 J2SE
 test client having the test cases
 mentioned in the documentation. It will be there in the next patch
 along
 with issue resolution for 2) and 3).
 The unit test cases are not added to the rdb core test suite as, the
 current unit tests' db ,
 table creation - does not support the multi-schema condition, and
 instead
 of scattering many new
  tables,scema, classes in the unit tests, same test cases will be shown
 using a separate J2SE test client
  sample. For unit testing, this sample can be modified and tested.

 How do you plan to automate the tests around this, if you use a J2SE
 sample
 instead of JUnit ?
 How difficult would be to extend the current unit tests database
 framework
 to support the TUSCANY-952 requirements?


 -- Forwarded message --
 From: Amita Vadhavkar (JIRA) tuscany-dev@ws.apache.org
 Date: Apr 25, 2007 5:06 AM
 Subject: [jira] Commented: (TUSCANY-952) DAS must support queries that
 reference tables in different schemas
 To: tuscany-dev@ws.apache.org


[
 
https://issues.apache.org/jira/browse/TUSCANY-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491618
 ]

 Amita Vadhavkar commented on TUSCANY-952:
 -

 1)For the first issue regarding QualifiedColumn constructor:-
 QualifiedColumn(String name, boolean isDatabaseSchemaNameSupported),
 below
 is the explaination:-

 In QualifiesColumn - what is expected in name parameter is
 tableName.columnName - at the least.

 When multiple schema support is ON, the name parameter is expected to
 have
 schemaName.tableName.columnName .

 So in both the cases tableName.columnName is the minimum requirement.
 Thus
 invoking the
 constructor like QualifiedColumn(table, false) does not follow the
 minimum
 requirement,
 because irrespective of multi-schema support, at least one '.' needs to
 be
 there in 'name'.

 With this the current logic in the code looks OK, if it throws
 RuntimeException for
 new QualifiedColumn(table, false)

 2) For second issue regarding
 MappingWrapper.addRelationship (Vector, Vector) -
 work-in-progress

 3) addConverter(String name, String converter) - the existing code will
 as
 such work correct, as
 findOrCreateTable(column) is using QualifiedColumn which has schemaName
 information as a member
 variable.
 Still, will clean code and will add more comments.

 4) As mentioned during last patch submission,  work-in-progress for a
 J2SE
 test client having the test cases
 mentioned in the documentation. It will be there in the next patch along

 with issue resolution for 2) and 3).
 The unit test cases are not added to the rdb core test suite as, the
 current
 unit tests' db , table creation - does
 not support the multi-schema condition, and instead of scattering many
 new
 tables,scema, classes in the unit tests, same test cases will be shown
 using
 a separate J2SE test client sample. For unit testing, this sample can be
 modified and tested.

  DAS must support queries that reference tables in different schemas
  -
 
  Key: TUSCANY-952
  URL: https://issues.apache.org/jira/browse/TUSCANY-952

  Project: Tuscany
   Issue Type: Bug
   Components: Java DAS RDB
 Reporter: Kevin Williams
  Fix For: Java-DAS-Mx
 
  Attachments: DAS-JIRA-952-Apr24-Amita.txt,
 JIRA-952-Details.doc,
 JIRA-952-Feb16-Amita.jar, JIRA-952-Mar01-Amita.jar
 
 
  The DAS is curently ignorant of database schema designations

Patches and Unit Tests, was Fwd: [jira] Commented: (TUSCANY-952) DAS must support queries that reference tables in different schemas

2007-04-25 Thread Luciano Resende

Thanks Adriano for helping reviewing some of the patches...

I also noticed that there was no unit tests on the patch (at least on the
latest one). I think we should really encourage the submission of unit tests
along with patches that are improvements to existing features or new
features.


-- Forwarded message --
From: Adriano Crestani (JIRA) tuscany-dev@ws.apache.org
Date: Apr 25, 2007 12:32 AM
Subject: [jira] Commented: (TUSCANY-952) DAS must support queries that
reference tables in different schemas
To: tuscany-dev@ws.apache.org


   [
https://issues.apache.org/jira/browse/TUSCANY-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491540]

Adriano Crestani commented on TUSCANY-952:
--

I don't know if I'm correct, but the condition in the method below shouldn't
be the inverse?

Actually:
   public void addConverter(String name, String converter) {

   QualifiedColumn column = new QualifiedColumn(name);
   Table t = null;
   if(this.config.isDatabaseSchemaNameSupported()){
   t = findOrCreateTable(column);
   }
   else{
   t = findOrCreateTable(column.getSchemaName(),
column.getTableName());//JIRA-952
   }
   Column c = findOrCreateColumn(t, column.getColumnName());
   c.setConverterClassName(converter);

   }

Suggested:
...
  if(this.config.isDatabaseSchemaNameSupported()){
   t = findOrCreateTable(column.getSchemaName(),
column.getTableName());//JIRA-952

   }
   else{
   t = findOrCreateTable(column);
   }
...

(Sorry for the indentation, but it's difficult to indent code on these
comments :s)

Cause there is only schema name if the database schema name is supported.

Adriano Crestani


DAS must support queries that reference tables in different schemas
-

Key: TUSCANY-952
URL: https://issues.apache.org/jira/browse/TUSCANY-952
Project: Tuscany
 Issue Type: Bug
 Components: Java DAS RDB
   Reporter: Kevin Williams
Fix For: Java-DAS-Mx

Attachments: DAS-JIRA-952-Apr24-Amita.txt, JIRA-952-Details.doc,

JIRA-952-Feb16-Amita.jar, JIRA-952-Mar01-Amita.jar



The DAS is curently ignorant of database schema designations.  This means

the DAS will generate incorrect write statements when it processes the
change summary from a data graph that originated from a query that uses
schema names that are different from the default schema.

--
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]



--
Luciano Resende
http://people.apache.org/~lresende


[jira] Commented: (TUSCANY-952) DAS must support queries that reference tables in different schemas

2007-04-25 Thread Amita Vadhavkar (JIRA)

[ 
https://issues.apache.org/jira/browse/TUSCANY-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491618
 ] 

Amita Vadhavkar commented on TUSCANY-952:
-

1)For the first issue regarding QualifiedColumn constructor:-
QualifiedColumn(String name, boolean isDatabaseSchemaNameSupported), below is 
the explaination:-

In QualifiesColumn - what is expected in name parameter is 
tableName.columnName - at the least.

When multiple schema support is ON, the name parameter is expected to have
schemaName.tableName.columnName.

So in both the cases tableName.columnName is the minimum requirement. Thus 
invoking the 
constructor like QualifiedColumn(table, false) does not follow the minimum 
requirement,
because irrespective of multi-schema support, at least one '.' needs to be 
there in 'name'. 

With this the current logic in the code looks OK, if it throws RuntimeException 
for 
new QualifiedColumn(table, false)

2) For second issue regarding
MappingWrapper.addRelationship(Vector, Vector) -
work-in-progress

3) addConverter(String name, String converter) - the existing code will as such 
work correct, as 
findOrCreateTable(column) is using QualifiedColumn which has schemaName 
information as a member
variable. 
Still, will clean code and will add more comments.

4) As mentioned during last patch submission,  work-in-progress for a J2SE test 
client having the test cases
mentioned in the documentation. It will be there in the next patch along with 
issue resolution for 2) and 3).
The unit test cases are not added to the rdb core test suite as, the current 
unit tests' db , table creation - does 
not support the multi-schema condition, and instead of scattering many new 
tables,scema, classes in the unit tests, same test cases will be shown using a 
separate J2SE test client sample. For unit testing, this sample can be modified 
and tested.

 DAS must support queries that reference tables in different schemas
 -

 Key: TUSCANY-952
 URL: https://issues.apache.org/jira/browse/TUSCANY-952
 Project: Tuscany
  Issue Type: Bug
  Components: Java DAS RDB
Reporter: Kevin Williams
 Fix For: Java-DAS-Mx

 Attachments: DAS-JIRA-952-Apr24-Amita.txt, JIRA-952-Details.doc, 
 JIRA-952-Feb16-Amita.jar, JIRA-952-Mar01-Amita.jar


 The DAS is curently ignorant of database schema designations.  This means the 
 DAS will generate incorrect write statements when it processes the change 
 summary from a data graph that originated from a query that uses schema names 
 that are different from the default schema.

-- 
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]



[jira] Commented: (TUSCANY-952) DAS must support queries that reference tables in different schemas

2007-04-24 Thread Adriano Crestani (JIRA)

[ 
https://issues.apache.org/jira/browse/TUSCANY-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491452
 ] 

Adriano Crestani commented on TUSCANY-952:
--

Amita, I was revising your classes and found some problems:

 - The following constructor:

...
public QualifiedColumn(String name, boolean isDatabaseSchemaNameSupported) {
int index = name.indexOf('.');
if ( index == -1 ) {
throw new RuntimeException(Column  + name +  must be qualified 
with a table name and optional schema name);
}
...

If a new QualifiedColumn(table, false) is invoked, it will throw an 
RuntimeException because it doesn't check if on the first condition the 
variable isDatabaseSchemaNameSupported.

I suggest a modification on the first condition:

...
if ( index == -1  !isDatabaseSchemaNameSupported) {
throw new RuntimeException(Column  + name +  must be qualified 
with a table name and optional schema name);
}
...

-

Another doubt on MappingWrapper.addRelationship(Vector parentNames, Vector 
childNames) that you create two VectorQualifiedColumn and add new 
QualifiedColumns are being created with QualifiedColumn(String tableName) 
constructor. This way it will not load the schema name. I commented it on the 
code bellow:

...
public Relationship addRelationship(Vector parentNames, Vector childNames) {
//create vector for each
if(parentNames.size() != childNames.size()){
throw new RuntimeException(Can not for relationship for multiple 
keys, different sizes);
}

Vector parentColumns = new Vector();
Vector childColumns = new Vector();

for(int i=0; iparentNames.size(); i++){
// it should be checked if the schema name is supported and use 
another constructor for it  
QualifiedColumn parent = new 
QualifiedColumn((String)parentNames.get(i));
QualifiedColumn child = new 
QualifiedColumn((String)childNames.get(i));

parentColumns.add(parent);
childColumns.add(child);
}

//all parent columns should be from same table and schema
//all child columns should be from same table and schema
checkTableNames(parentColumns);
checkSchemaNames(parentColumns);

checkTableNames(childColumns);
checkSchemaNames(childColumns);

Relationship r = FACTORY.createRelationship();
//JIRA-952
if(this.config.isDatabaseSchemaNameSupported()){  
 
   // As the QualifiedColumns are being created with 
QualifiedName(String name) constructor, the method getShemaName will always 
return 

r.setName(((QualifiedColumn)childColumns.get(0)).getSchemaName()+.
+((QualifiedColumn)childColumns.get(0)).getTableName());

r.setPrimaryKeyTable(((QualifiedColumn)parentColumns.get(0)).getSchemaName()+.

+((QualifiedColumn)parentColumns.get(0)).getTableName());

r.setForeignKeyTable(((QualifiedColumn)childColumns.get(0)).getSchemaName()+.

+((QualifiedColumn)childColumns.get(0)).getTableName());
}
else{
r.setName(((QualifiedColumn)childColumns.get(0)).getTableName());

r.setPrimaryKeyTable(((QualifiedColumn)parentColumns.get(0)).getTableName());

r.setForeignKeyTable(((QualifiedColumn)childColumns.get(0)).getTableName());
}
...

-

I didn't check all your code yet, I will wait for clarifications ; )

Adriano Crestani

 DAS must support queries that reference tables in different schemas
 -

 Key: TUSCANY-952
 URL: https://issues.apache.org/jira/browse/TUSCANY-952
 Project: Tuscany
  Issue Type: Bug
  Components: Java DAS RDB
Reporter: Kevin Williams
 Fix For: Java-DAS-Mx

 Attachments: DAS-JIRA-952-Apr24-Amita.txt, JIRA-952-Details.doc, 
 JIRA-952-Feb16-Amita.jar, JIRA-952-Mar01-Amita.jar


 The DAS is curently ignorant of database schema designations.  This means the 
 DAS will generate incorrect write statements when it processes the change 
 summary from a data graph that originated from a query that uses schema names 
 that are different from the default schema.

-- 
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]



[jira] Commented: (TUSCANY-952) DAS must support queries that reference tables in different schemas

2007-02-27 Thread Amita Vadhavkar (JIRA)

[ 
https://issues.apache.org/jira/browse/TUSCANY-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476093
 ] 

Amita Vadhavkar commented on TUSCANY-952:
-

Based on the discussion on thread 
http://www.mail-archive.com/tuscany-dev@ws.apache.org/msg14361.html
it was discussed that for completeness of JIRA-952, when multi schema support 
is ON, the names of the stored procedures should be fully qualified (including 
schema name) when these are database stored procedures.  This is the convention 
to be followed by user. It can not be checked programmatically, because
in case of java stored procedure, schema name is irrelevant and there is no way 
to distinguish between
java stored procedure and database stored procedure. Thus, this needs to be 
documented at the appropriate place in user guide.

 DAS must support queries that reference tables in different schemas
 -

 Key: TUSCANY-952
 URL: https://issues.apache.org/jira/browse/TUSCANY-952
 Project: Tuscany
  Issue Type: Bug
  Components: Java DAS RDB
Affects Versions: Java-SCA-Mx
Reporter: Kevin Williams
 Fix For: Java-DAS-Mx

 Attachments: JIRA-952-Feb16-Amita.jar


 The DAS is curently ignorant of database schema designations.  This means the 
 DAS will generate incorrect write statements when it processes the change 
 summary from a data graph that originated from a query that uses schema names 
 that are different from the default schema.

-- 
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]



[jira] Commented: (TUSCANY-952) DAS must support queries that reference tables in different schemas

2006-11-29 Thread Kevin Williams (JIRA)
[ 
http://issues.apache.org/jira/browse/TUSCANY-952?page=comments#action_12454468 
] 

Kevin Williams commented on TUSCANY-952:


Dev list thread here:
http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg11282.html

 DAS must support queries that reference tables in different schemas
 -

 Key: TUSCANY-952
 URL: http://issues.apache.org/jira/browse/TUSCANY-952
 Project: Tuscany
  Issue Type: Bug
  Components: Java DAS RDB
Affects Versions: Java-Mx
Reporter: Kevin Williams
 Fix For: Java-Mx


 The DAS is curently ignorant of database schema designations.  This means the 
 DAS will generate incorrect write statements when it processes the change 
 summary from a data graph that originated from a query that uses schema names 
 that are different from the default schema.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



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