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 szul <sz...@freemail.hu> on 2003/10/18 13:46:15 UTC

Syntax error with SyBase Anywhere

Hello,

We'd like to use SyBase Anywhere with Torque.
Environment:
  - Torque 3.0.2
  - Adaptive Server AnyWhere 9.0.0.1110
  - JConnect 5.5

  We have the following problems:
  - Selects work fine, but when doing inserts and updates we receive the 
following error message:
"com.sybase.jdbc2.jdbc.SybSQLException: ASA Error -131: Syntax error near 
')' on line 1".
After inspecting the code it turned out that for some strange reason the 
insert SQL statements are empty (no column names, no values). We did some 
debugging and we saw that the JDBC driver always returns true for the 
readonly flag for the metadata of the columns in question.

  - We can connect to the database from JDBC only if the user has the DBA 
right. Resource users and users with rights explicitly specified (select, 
insert, update, delete) cannot connect.

  Is there anyone who experienced similar problems and have found the 
solution?

Thanks,



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


Re: running out of connections w/ postgresql

Posted by Peter Courcoux <pe...@courcoux.biz>.
Michael,

This is a known issue. Comment out the section referring to Torque's old
pool and use the jdbc2 pool (Next section in Torque.props).

Regards,

Peter

On Sun, 2003-10-19 at 00:55, Michael Della Bitta wrote:
> Hello,
> 
> I currently have a site in production using Torque and connecting to  
> PostgreSQL. During my load testing, it held up solidly. But now that I  
> have it in production, it keeps on running out of connections. If I  
> restart Tomcat, things proceed normally. It seems like Torque isn't  
> checking connections back in when it expires them or something.
> 
> Here are the properties from my Torque.properties file (identifying  
> info altered to protect the innocent):
> 
> -------------------------------------------
> torque.applicationRoot = .
> 
> log4j.category.org.apache.torque = WARN, org.apache.torque
> log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
> log4j.appender.org.apache.torque.file = /Library/Tomcat/logs/torque.log
> log4j.appender.org.apache.torque.layout = org.apache.log4j.PatternLayout
> log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t]  
> %-5p %c - %m%n
> log4j.appender.org.apache.torque.append = true
> 
> ## Using torque's old pool
> torque.database.default = dbname
> torque.database.dbname.adapter=postgresql
> 
> torque.dsfactory.dbname.factory=org.apache.torque.dsfactory.TorqueDataSo 
> urceFactory
> torque.dsfactory.dbname.pool.defaultMaxConnections=25
> torque.dsfactory.dbname.pool.maxExpiryTime=3600
> torque.dsfactory.dbname.pool.connectionWaitTimeout=10
> torque.dsfactory.dbname.connection.driver = org.postgresql.Driver
> torque.dsfactory.dbname.connection.url =  
> jdbc:postgresql://127.0.0.1:5432/dbname
> torque.dsfactory.dbname.connection.user = dbuser
> torque.dsfactory.dbname.connection.password = dbpassword
> -----------------------------
> 
> 
> and i'm initializing Torque using a servlet that's loaded on startup  
> like this:
> 
> -------------------------------
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> import org.apache.torque.*;
> 
> public class InitServlet extends HttpServlet {
>      public void init() throws ServletException {
>          try {
>               
> Torque.init("/Library/Tomcat/webapps/appname/torque-3.0.2/ 
> Torque.properties");
> 
>          } catch (TorqueException te) {
>              throw new ServletException("ERROR - Unable to init Torque:  
> " + te);
>          }
>      }
> }
> --------------------------------
> 
> any ideas, anyone?
> 
> thanks,
> 
> michael
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
-- 
Peter Courcoux <pe...@courcoux.biz>

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


Re: running out of connections w/ postgresql

Posted by Justin Wood <ju...@braidquest.com>.
Thanks, Scott!  Had an old jar in the libs directory (sheepish grin).

Michael Della Bitta, see the attached test.  This will definitely be able to 
trap your problem before your deploy to production (if you haven't done so 
already).    You will need to change the name of the *Peer class and the path 
to your Torque.properties

Justin

On Wednesday 05 November 2003 06:48, Scott Eade wrote:
> I cannot promise that I can help solve your problem, but it will help
> generally if you can provide the contents of your Torque.properties
> file.  The unit test may also be useful - it can't hurt to post it.
>
> On commons-dev there was a thread about running out of connections
> when mixing versions of dbcp and pool so it is worth double checking
> that there are no old versions laying around causing problems.
>
> Scott

Re: running out of connections w/ postgresql

Posted by Scott Eade <se...@backstagetech.com.au>.
I cannot promise that I can help solve your problem, but it will help
generally if you can provide the contents of your Torque.properties
file.  The unit test may also be useful - it can't hurt to post it.

On commons-dev there was a thread about running out of connections
when mixing versions of dbcp and pool so it is worth double checking
that there are no old versions laying around causing problems.

Scott

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


Justin Wood wrote:

>I don't know how far you've moved on this thing since Friday but I have 
>replaced my DBCP and Pool with versions 1.1 and still have the problem and I 
>am using Torque 3.1 .   I have a JUnit test that tests to failure if you 
>would like me to send it to you.   I just run it out of ant  lots of times 
>(>32) till it falls over at the 32nd time.  The max number of connections 
>allowed by default by prostgres is 32.   
>
>Are there any Torque developers out there that can give us some help before we 
>get our hands dirty with the source?
>
>Justin
>  
>




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


Re: running out of connections w/ postgresql

Posted by Justin Wood <ju...@braidquest.com>.
I don't know how far you've moved on this thing since Friday but I have 
replaced my DBCP and Pool with versions 1.1 and still have the problem and I 
am using Torque 3.1 .   I have a JUnit test that tests to failure if you 
would like me to send it to you.   I just run it out of ant  lots of times 
(>32) till it falls over at the 32nd time.  The max number of connections 
allowed by default by prostgres is 32.   

Are there any Torque developers out there that can give us some help before we 
get our hands dirty with the source?

Justin

On Friday 31 October 2003 04:13, Michael Della Bitta wrote:
>   i have been running into trouble performing this switch. i was
> following the directions at this site:
>
> http://jakarta.apache.org/turbine/torque-3.0.0/jdbc2pool-howto.html
>
> but it says you need a newer version of the commons-dbcp.jar than was
> included with the Torque distribution that i downloaded (3.0.2).
> upgrading this has become a hassle, because it seems like that project
> has gone through a major revision since (1.1) and i can't find the 1.0
> final release. if i go with dbcp 1.1, it seems like i need to use
> torque 3.1 as well, and commons-pool 1.1. now i'm swapping in three
> jars that are a major release ahead of what i was previously using. i'm
> uncomfortable just doing that, because this application is in
> production, and the problems with the builtin pool didn't surface until
> it launched (even through stress and load testing).
>
> it's a bit of a headache. i'm just copying my application's context and
> trying the upgrades there... i don't know how to evaluate their
> stability if my previous testing didn't uncover the stability problems
> with the older software.
>
> thanks for your help,
>
> michael
>
> On Oct 30, 2003, at 4:50 PM, Eitan Katznelson wrote:
> > I had the same problem and switched to the new DataSourceFactory
> > org.apache.torque.dsfactory.Jdbc2PoolDataSourceFactory. When
> > researching the
> > issue on the web, I couldn't find out exactly what was causing it but
> > several people have run into this problem.
> >
> > Hope this helps,
> > Eitan
> >
> > -----Original Message-----
> > From: Michael Della Bitta [mailto:mdellabitta1@earthlink.net]
> > Sent: Saturday, October 18, 2003 3:55 PM
> > To: Apache Torque Users List
> >
> > Hello,
> >
> > I currently have a site in production using Torque and connecting to
> > PostgreSQL. During my load testing, it held up solidly. But now that I
> > have it in production, it keeps on running out of connections. If I
> > restart Tomcat, things proceed normally. It seems like Torque isn't
> > checking connections back in when it expires them or something.
> >
> > Here are the properties from my Torque.properties file (identifying
> > info altered to protect the innocent):
> >
> > -------------------------------------------
> > torque.applicationRoot = .
> >
> > log4j.category.org.apache.torque = WARN, org.apache.torque
> > log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
> > log4j.appender.org.apache.torque.file = /Library/Tomcat/logs/torque.log
> > log4j.appender.org.apache.torque.layout =
> > org.apache.log4j.PatternLayout
> > log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t]
> > %-5p %c - %m%n
> > log4j.appender.org.apache.torque.append = true
> >
> > ## Using torque's old pool
> > torque.database.default = dbname
> > torque.database.dbname.adapter=postgresql
> >
> > torque.dsfactory.dbname.factory=org.apache.torque.dsfactory.TorqueDataS
> > o
> > urceFactory
> > torque.dsfactory.dbname.pool.defaultMaxConnections=25
> > torque.dsfactory.dbname.pool.maxExpiryTime=3600
> > torque.dsfactory.dbname.pool.connectionWaitTimeout=10
> > torque.dsfactory.dbname.connection.driver = org.postgresql.Driver
> > torque.dsfactory.dbname.connection.url =
> > jdbc:postgresql://127.0.0.1:5432/dbname
> > torque.dsfactory.dbname.connection.user = dbuser
> > torque.dsfactory.dbname.connection.password = dbpassword
> > -----------------------------
> >
> >
> > and i'm initializing Torque using a servlet that's loaded on startup
> > like this:
> >
> > -------------------------------
> > import java.io.*;
> > import javax.servlet.*;
> > import javax.servlet.http.*;
> > import org.apache.torque.*;
> >
> > public class InitServlet extends HttpServlet {
> >      public void init() throws ServletException {
> >          try {
> >
> > Torque.init("/Library/Tomcat/webapps/appname/torque-3.0.2/
> > Torque.properties");
> >
> >          } catch (TorqueException te) {
> >              throw new ServletException("ERROR - Unable to init Torque:
> > " + te);
> >          }
> >      }
> > }
> > --------------------------------
> >
> > any ideas, anyone?
> >
> > thanks,
> >
> > michael
> >
> >
> > ---------------------------------------------------------------------
> > 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


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


Re: running out of connections w/ postgresql

Posted by Michael Della Bitta <md...@columbia.edu>.
  i have been running into trouble performing this switch. i was  
following the directions at this site:

http://jakarta.apache.org/turbine/torque-3.0.0/jdbc2pool-howto.html

but it says you need a newer version of the commons-dbcp.jar than was  
included with the Torque distribution that i downloaded (3.0.2).  
upgrading this has become a hassle, because it seems like that project  
has gone through a major revision since (1.1) and i can't find the 1.0  
final release. if i go with dbcp 1.1, it seems like i need to use  
torque 3.1 as well, and commons-pool 1.1. now i'm swapping in three  
jars that are a major release ahead of what i was previously using. i'm  
uncomfortable just doing that, because this application is in  
production, and the problems with the builtin pool didn't surface until  
it launched (even through stress and load testing).

it's a bit of a headache. i'm just copying my application's context and  
trying the upgrades there... i don't know how to evaluate their  
stability if my previous testing didn't uncover the stability problems  
with the older software.

thanks for your help,

michael

On Oct 30, 2003, at 4:50 PM, Eitan Katznelson wrote:

> I had the same problem and switched to the new DataSourceFactory
> org.apache.torque.dsfactory.Jdbc2PoolDataSourceFactory. When  
> researching the
> issue on the web, I couldn't find out exactly what was causing it but
> several people have run into this problem.
>
> Hope this helps,
> Eitan
>
> -----Original Message-----
> From: Michael Della Bitta [mailto:mdellabitta1@earthlink.net]
> Sent: Saturday, October 18, 2003 3:55 PM
> To: Apache Torque Users List
>
> Hello,
>
> I currently have a site in production using Torque and connecting to
> PostgreSQL. During my load testing, it held up solidly. But now that I
> have it in production, it keeps on running out of connections. If I
> restart Tomcat, things proceed normally. It seems like Torque isn't
> checking connections back in when it expires them or something.
>
> Here are the properties from my Torque.properties file (identifying
> info altered to protect the innocent):
>
> -------------------------------------------
> torque.applicationRoot = .
>
> log4j.category.org.apache.torque = WARN, org.apache.torque
> log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
> log4j.appender.org.apache.torque.file = /Library/Tomcat/logs/torque.log
> log4j.appender.org.apache.torque.layout =  
> org.apache.log4j.PatternLayout
> log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t]
> %-5p %c - %m%n
> log4j.appender.org.apache.torque.append = true
>
> ## Using torque's old pool
> torque.database.default = dbname
> torque.database.dbname.adapter=postgresql
>
> torque.dsfactory.dbname.factory=org.apache.torque.dsfactory.TorqueDataS 
> o
> urceFactory
> torque.dsfactory.dbname.pool.defaultMaxConnections=25
> torque.dsfactory.dbname.pool.maxExpiryTime=3600
> torque.dsfactory.dbname.pool.connectionWaitTimeout=10
> torque.dsfactory.dbname.connection.driver = org.postgresql.Driver
> torque.dsfactory.dbname.connection.url =
> jdbc:postgresql://127.0.0.1:5432/dbname
> torque.dsfactory.dbname.connection.user = dbuser
> torque.dsfactory.dbname.connection.password = dbpassword
> -----------------------------
>
>
> and i'm initializing Torque using a servlet that's loaded on startup
> like this:
>
> -------------------------------
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> import org.apache.torque.*;
>
> public class InitServlet extends HttpServlet {
>      public void init() throws ServletException {
>          try {
>
> Torque.init("/Library/Tomcat/webapps/appname/torque-3.0.2/
> Torque.properties");
>
>          } catch (TorqueException te) {
>              throw new ServletException("ERROR - Unable to init Torque:
> " + te);
>          }
>      }
> }
> --------------------------------
>
> any ideas, anyone?
>
> thanks,
>
> michael
>
>
> ---------------------------------------------------------------------
> 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: running out of connections w/ postgresql

Posted by Justin Wood <ju...@braidquest.com>.
Does _someone_ know what is causing this?

Justin

On Thursday 30 October 2003 23:50, Eitan Katznelson wrote:
> I had the same problem and switched to the new DataSourceFactory
> org.apache.torque.dsfactory.Jdbc2PoolDataSourceFactory. When researching
> the issue on the web, I couldn't find out exactly what was causing it but
> several people have run into this problem.
>
> Hope this helps,
> Eitan
>
[snip]


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


RE: running out of connections w/ postgresql

Posted by Eitan Katznelson <ei...@quimbik.com>.
I had the same problem and switched to the new DataSourceFactory
org.apache.torque.dsfactory.Jdbc2PoolDataSourceFactory. When researching the
issue on the web, I couldn't find out exactly what was causing it but
several people have run into this problem.

Hope this helps,
Eitan

-----Original Message-----
From: Michael Della Bitta [mailto:mdellabitta1@earthlink.net] 
Sent: Saturday, October 18, 2003 3:55 PM
To: Apache Torque Users List

Hello,

I currently have a site in production using Torque and connecting to  
PostgreSQL. During my load testing, it held up solidly. But now that I  
have it in production, it keeps on running out of connections. If I  
restart Tomcat, things proceed normally. It seems like Torque isn't  
checking connections back in when it expires them or something.

Here are the properties from my Torque.properties file (identifying  
info altered to protect the innocent):

-------------------------------------------
torque.applicationRoot = .

log4j.category.org.apache.torque = WARN, org.apache.torque
log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
log4j.appender.org.apache.torque.file = /Library/Tomcat/logs/torque.log
log4j.appender.org.apache.torque.layout = org.apache.log4j.PatternLayout
log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t]  
%-5p %c - %m%n
log4j.appender.org.apache.torque.append = true

## Using torque's old pool
torque.database.default = dbname
torque.database.dbname.adapter=postgresql

torque.dsfactory.dbname.factory=org.apache.torque.dsfactory.TorqueDataSo 
urceFactory
torque.dsfactory.dbname.pool.defaultMaxConnections=25
torque.dsfactory.dbname.pool.maxExpiryTime=3600
torque.dsfactory.dbname.pool.connectionWaitTimeout=10
torque.dsfactory.dbname.connection.driver = org.postgresql.Driver
torque.dsfactory.dbname.connection.url =  
jdbc:postgresql://127.0.0.1:5432/dbname
torque.dsfactory.dbname.connection.user = dbuser
torque.dsfactory.dbname.connection.password = dbpassword
-----------------------------


and i'm initializing Torque using a servlet that's loaded on startup  
like this:

-------------------------------
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.torque.*;

public class InitServlet extends HttpServlet {
     public void init() throws ServletException {
         try {
              
Torque.init("/Library/Tomcat/webapps/appname/torque-3.0.2/ 
Torque.properties");

         } catch (TorqueException te) {
             throw new ServletException("ERROR - Unable to init Torque:  
" + te);
         }
     }
}
--------------------------------

any ideas, anyone?

thanks,

michael


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


running out of connections w/ postgresql

Posted by Michael Della Bitta <md...@earthlink.net>.
Hello,

I currently have a site in production using Torque and connecting to  
PostgreSQL. During my load testing, it held up solidly. But now that I  
have it in production, it keeps on running out of connections. If I  
restart Tomcat, things proceed normally. It seems like Torque isn't  
checking connections back in when it expires them or something.

Here are the properties from my Torque.properties file (identifying  
info altered to protect the innocent):

-------------------------------------------
torque.applicationRoot = .

log4j.category.org.apache.torque = WARN, org.apache.torque
log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
log4j.appender.org.apache.torque.file = /Library/Tomcat/logs/torque.log
log4j.appender.org.apache.torque.layout = org.apache.log4j.PatternLayout
log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t]  
%-5p %c - %m%n
log4j.appender.org.apache.torque.append = true

## Using torque's old pool
torque.database.default = dbname
torque.database.dbname.adapter=postgresql

torque.dsfactory.dbname.factory=org.apache.torque.dsfactory.TorqueDataSo 
urceFactory
torque.dsfactory.dbname.pool.defaultMaxConnections=25
torque.dsfactory.dbname.pool.maxExpiryTime=3600
torque.dsfactory.dbname.pool.connectionWaitTimeout=10
torque.dsfactory.dbname.connection.driver = org.postgresql.Driver
torque.dsfactory.dbname.connection.url =  
jdbc:postgresql://127.0.0.1:5432/dbname
torque.dsfactory.dbname.connection.user = dbuser
torque.dsfactory.dbname.connection.password = dbpassword
-----------------------------


and i'm initializing Torque using a servlet that's loaded on startup  
like this:

-------------------------------
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.torque.*;

public class InitServlet extends HttpServlet {
     public void init() throws ServletException {
         try {
              
Torque.init("/Library/Tomcat/webapps/appname/torque-3.0.2/ 
Torque.properties");

         } catch (TorqueException te) {
             throw new ServletException("ERROR - Unable to init Torque:  
" + te);
         }
     }
}
--------------------------------

any ideas, anyone?

thanks,

michael


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