You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by T E Schmitz <ma...@numerixtechnology.de> on 2004/03/30 19:18:57 UTC

Torque.init / setting dbcp properties fails

Hello,

Torque.init causes the following errors:

ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
(setProperty) Property: logInterval value: 0 is not supported by 
DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
(setProperty) Property: connectionWaitTimeout value: 10 is not supported 
by DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
(setProperty) Property: defaultMaxConnections value: 80 is not supported 
by DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
(setProperty) Property: maxExpiryTime value: 3600 is not supported by 
DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
(setProperty) Property: testOnBorrow value: true is not supported by 
DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
(setProperty) Property: validationQuery value: SELECT 1 is not supported 
by DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource


My set-up:
PostgreSQL 7.2.1, torque 3.1, Java 2 SDK 1.4.2_01, Windows 2000,

I have managed to eliminate the last two errors by using the latest 
commons-dbcp-1.1.jar instead of the one that shipped with Torque 3.1.

I have tried various postgresql drivers but that has no effect. My 
impression is that it has nothing to do with the database driver.

Prior database intialization with the torqe generated SQL worked fine. 
Inserting a record into one of the tables also works despite the errors 
during Torque.init().

I noticed somebody else posted a similar problem in December, but the 
issue doesn't seem to have been resolved; at least it wasn't mentioned 
in the thread. (see 
www.mail-archive.com/torque-user@db.apache.org/msg01873.html)


Any help would be much appreciated.


-- 


Best Regards,

Tarlika Elisabeth Schmitz

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


RE: MSSQL problems with reserved words

Posted by Alexandru Dovlecel <al...@siemens.com>.
HI Alllll :))))

Me very very happy. :)))

I have changed the templates for MSSQL server so that now it should work if
you have table names that conflict with MSSQL keywords. At least seems to
work a table called SCHEMA.

I haven't done any changes so that you can add a collumn that has a wrong
MSSQL name. If you like to add this kind of support, then... say so and work
on it :))). Maibe I will add support for this also.

Should I post these new templates somewhere? BTW, they are not fully tested,
only base tests. So if there is a standard rutine to test changes in
templates, pls tell me about it.

Hope it will help somebody (except me),
Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


RE: MSSQL problems with reserved words

Posted by Alexandru Dovlecel <al...@siemens.com>.
Hi K,

I have to stick to the database design specified by other team that is using
.NET. For now, I did what you recomended me in this mail. But this is until
I fix this problem.

I did not try to use the JDBC 2 SChema feature but I doubt it will work. I
might try it later. For now I try to change the templates for generating the
SQL. But there is also the problem of the SELECT clause. I cannot have a
SELECT * FROM SCHEMA. I think this could be solved by setting the TABLE_NAME
= "[SCHEMA]". I hope it will not mess up other Torque functionality.

New ideas?

Thanks for the answer,
Alex

> Hi Alex,
> Why table name schema is so important for you? Can you name a
> table somehow else, and if you need class named Schema,
> then specify a javaName="Schema" in your my-schema.xml.
>
> Regards,
> Kostya
>
> Alexandru Dovlecel wrote:
>
> > Hi all,
> >
> > Pls need help ASAP. I have a database that contains tables
> that are reserved
> > words for mssql. E.g. one table is called SCHEMA. When I
> generate the code
> > from my-schema.xml, it generates the my-schema.sql file.
> When running the
> > sql file in the mssql I get an error: SCHEMA keyword not
> expected after
> > CREATE TABLE (or something like this). I can do this by generating
> > CREATE TABLE [SCHEMA]. But if I put the table name as
> "[SCHEMA]" then the
> > primary key triggers are not correct (e.g. [SCHEMA]_PK is
> not a valid name).
> >
> > How can I overcome this problem? Does anyone have some patched mssql
> > templates for generating the sql and the OM classes?
> >
> > Any suggestions? Pls help.
> >
> > Thanks alot,
> > Alex
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-user-help@db.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: MSSQL problems with reserved words

Posted by Kostyantyn Shchekotykhin <ko...@ifit.uni-klu.ac.at>.
Hi Alex,
Why table name schema is so important for you? Can you name a table somehow else, and if you need class named Schema, 
then specify a javaName="Schema" in your my-schema.xml.

Regards,
Kostya

Alexandru Dovlecel wrote:

> Hi all,
> 
> Pls need help ASAP. I have a database that contains tables that are reserved
> words for mssql. E.g. one table is called SCHEMA. When I generate the code
> from my-schema.xml, it generates the my-schema.sql file. When running the
> sql file in the mssql I get an error: SCHEMA keyword not expected after
> CREATE TABLE (or something like this). I can do this by generating
> CREATE TABLE [SCHEMA]. But if I put the table name as "[SCHEMA]" then the
> primary key triggers are not correct (e.g. [SCHEMA]_PK is not a valid name).
> 
> How can I overcome this problem? Does anyone have some patched mssql
> templates for generating the sql and the OM classes?
> 
> Any suggestions? Pls help.
> 
> Thanks alot,
> Alex
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


RE: MSSQL problems with reserved words

Posted by Leo Gaggl <le...@autom-8.com>.
Hi Alex,

I have had the same problem. the only change you need to make is the angle
brackets around $table.Name

here is my torque-gen-3.1\templates\sql\base\mssql\table.vm:

---------- snip ------------------------------------------------------------

/* ---------------------------------------------------------------------- */
/* $table.Name                                                      */
/* ---------------------------------------------------------------------- */

$generator.parse("$basepath/drop.vm", "", "table", $tbl)
CREATE TABLE [$table.Name]
(
#set ( $cols = $generator.parse("$basepath/columns.vm", "", "table", $tbl) )
#set ( $pk = $generator.parse("$basepath/primarykey.vm", "", "table", $tbl)
)
#set ( $unique = $generator.parse("$basepath/unique.vm", "", "table", $tbl)
)
#if($strings.allEmpty([$pk,$unique]))$strings.chop($cols,1)#else$cols#end
#if($strings.allEmpty([$unique]) &&
$pk.length()>0)$strings.chop($pk,2)#else$pk#end
#if($unique.length()>0)$strings.chop($unique,2)#end
);

#set ( $index = $generator.parse("$basepath/index.vm", "", "table", $tbl) )
#if($index.length() > 0)$index#end

---------- snip ------------------------------------------------------------

If any of the committers thinks that's worth putting into CVS - pls. go
ahead.

Leo Gaggl
Adelaide, South Australia

 

-----Original Message-----
From: Alexandru Dovlecel [mailto:alexandru.dovlecel@siemens.com] 
Sent: Wednesday, 31 March 2004 18:46 PM
To: 'Apache Torque Users List'
Subject: MSSQL problems with reserved words

Hi all,

Pls need help ASAP. I have a database that contains tables that are reserved
words for mssql. E.g. one table is called SCHEMA. When I generate the code
from my-schema.xml, it generates the my-schema.sql file. When running the
sql file in the mssql I get an error: SCHEMA keyword not expected after
CREATE TABLE (or something like this). I can do this by generating CREATE
TABLE [SCHEMA]. But if I put the table name as "[SCHEMA]" then the primary
key triggers are not correct (e.g. [SCHEMA]_PK is not a valid name).

How can I overcome this problem? Does anyone have some patched mssql
templates for generating the sql and the OM classes?

Any suggestions? Pls help.

Thanks alot,
Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


MSSQL problems with reserved words

Posted by Alexandru Dovlecel <al...@siemens.com>.
Hi all,

Pls need help ASAP. I have a database that contains tables that are reserved
words for mssql. E.g. one table is called SCHEMA. When I generate the code
from my-schema.xml, it generates the my-schema.sql file. When running the
sql file in the mssql I get an error: SCHEMA keyword not expected after
CREATE TABLE (or something like this). I can do this by generating
CREATE TABLE [SCHEMA]. But if I put the table name as "[SCHEMA]" then the
primary key triggers are not correct (e.g. [SCHEMA]_PK is not a valid name).

How can I overcome this problem? Does anyone have some patched mssql
templates for generating the sql and the OM classes?

Any suggestions? Pls help.

Thanks alot,
Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: Torque.init / setting dbcp properties fails

Posted by T E Schmitz <ma...@numerixtechnology.de>.
Thank you Scott,
That's what I eventually figured ...


Regards,

Tarlika


Scott Eade wrote:

> See http://jakarta.apache.org/commons/dbcp/configuration.html for 
> information about configuring Jakarta Commons DBCP.
> 
> Scott
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: Torque.init / setting dbcp properties fails

Posted by Scott Eade <se...@backstagetech.com.au>.
See http://jakarta.apache.org/commons/dbcp/configuration.html for 
information about configuring Jakarta Commons DBCP.

Scott

-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au



T E Schmitz wrote:

> Could it be that the properties have simply been renamed / obsoloted 
> as follows in commons-dbcp:
>
> connectionWaitTimeout ==> maxWait ?
> defaultMaxConnections ==> obsoleted ?
> logInterval ==> obsoleted ?
> maxExpiryTime ==> removeAbandonedTimeout ?
>
> I also found mentioned that defaultMaxActive has been renamed:
> defaultMaxActive ==> maxActive
>
> I'm just guessing but in any case removing the above properties from 
> Torque.properties got rid of the errors.
>
>
> Regards,
>
> Tarlika Elisabeth Schmitz
>
>
> T E Schmitz wrote:
>
>> Hello,
>>
>> Torque.init causes the following errors:
>>
>> ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
>> (setProperty) Property: logInterval value: 0 is not supported by 
>> DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
>> ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
>> (setProperty) Property: connectionWaitTimeout value: 10 is not 
>> supported by DataSource: 
>> org.apache.commons.dbcp.datasources.SharedPoolDataSource
>> ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
>> (setProperty) Property: defaultMaxConnections value: 80 is not 
>> supported by DataSource: 
>> org.apache.commons.dbcp.datasources.SharedPoolDataSource
>> ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
>> (setProperty) Property: maxExpiryTime value: 3600 is not supported by 
>> DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
>> ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
>> (setProperty) Property: testOnBorrow value: true is not supported by 
>> DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
>> ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
>> (setProperty) Property: validationQuery value: SELECT 1 is not 
>> supported by DataSource: 
>> org.apache.commons.dbcp.datasources.SharedPoolDataSource
>>
>>
>> My set-up:
>> PostgreSQL 7.2.1, torque 3.1, Java 2 SDK 1.4.2_01, Windows 2000,
>>
>> I have managed to eliminate the last two errors by using the latest 
>> commons-dbcp-1.1.jar instead of the one that shipped with Torque 3.1.
>>
>> I have tried various postgresql drivers but that has no effect. My 
>> impression is that it has nothing to do with the database driver.
>>
>> Prior database intialization with the torqe generated SQL worked 
>> fine. Inserting a record into one of the tables also works despite 
>> the errors during Torque.init().
>>
>> I noticed somebody else posted a similar problem in December, but the 
>> issue doesn't seem to have been resolved; at least it wasn't 
>> mentioned in the thread. (see 
>> www.mail-archive.com/torque-user@db.apache.org/msg01873.html)
>>
>>
>> Any help would be much appreciated.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: Torque.init / setting dbcp properties fails

Posted by T E Schmitz <ma...@numerixtechnology.de>.
Could it be that the properties have simply been renamed / obsoloted as 
follows in commons-dbcp:

connectionWaitTimeout ==> maxWait ?
defaultMaxConnections ==> obsoleted ?
logInterval ==> obsoleted ?
maxExpiryTime ==> removeAbandonedTimeout ?

I also found mentioned that defaultMaxActive has been renamed:
defaultMaxActive ==> maxActive

I'm just guessing but in any case removing the above properties from 
Torque.properties got rid of the errors.


Regards,

Tarlika Elisabeth Schmitz


T E Schmitz wrote:

> Hello,
> 
> Torque.init causes the following errors:
> 
> ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
> (setProperty) Property: logInterval value: 0 is not supported by 
> DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
> ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
> (setProperty) Property: connectionWaitTimeout value: 10 is not supported 
> by DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
> ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
> (setProperty) Property: defaultMaxConnections value: 80 is not supported 
> by DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
> ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
> (setProperty) Property: maxExpiryTime value: 3600 is not supported by 
> DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
> ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
> (setProperty) Property: testOnBorrow value: true is not supported by 
> DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
> ERROR [org.apache.torque.dsfactory.AbstractDataSourceFactory] - 
> (setProperty) Property: validationQuery value: SELECT 1 is not supported 
> by DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
> 
> 
> My set-up:
> PostgreSQL 7.2.1, torque 3.1, Java 2 SDK 1.4.2_01, Windows 2000,
> 
> I have managed to eliminate the last two errors by using the latest 
> commons-dbcp-1.1.jar instead of the one that shipped with Torque 3.1.
> 
> I have tried various postgresql drivers but that has no effect. My 
> impression is that it has nothing to do with the database driver.
> 
> Prior database intialization with the torqe generated SQL worked fine. 
> Inserting a record into one of the tables also works despite the errors 
> during Torque.init().
> 
> I noticed somebody else posted a similar problem in December, but the 
> issue doesn't seem to have been resolved; at least it wasn't mentioned 
> in the thread. (see 
> www.mail-archive.com/torque-user@db.apache.org/msg01873.html)
> 
> 
> Any help would be much appreciated.
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org