db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Monroe" <Greg.Mon...@DukeCE.com>
Subject RE: RE : Still socket problems
Date Thu, 04 May 2006 17:12:39 GMT
My guess is that this is because all of Torque's 
calls are done as prepared statements (which is 
much safer than other calls). Probably, either the 
DB or the JDBC driver is doing some prepared statement
optimizing.  I know that jTDS has some options to 
do this (or not).  


> -----Original Message-----
> From: Thomas Fischer [mailto:fischer@seitenbau.net] 
> Sent: Thursday, May 04, 2006 11:49 AM
> To: Apache Torque Users List
> Subject: RE : Still socket problems
> 
> 
> Hi,
> 
> At the moment, Torque does not know how to use native limit 
> and offset of mssql (mssql's limit/offset support is kind of 
> nonstandard, I've been told). So it retrieves all datasets 
> and discards the ones it does not need. This is probably what 
> you are seeing.
> 
>      Thomas
> 
> P.S. Patches are welcome !
> 
> "KERNEUZET FREDERIC" <Frederic.Kerneuzet@pr-gicm.com> schrieb 
> am 04.05.2006
> 17:07:50:
> 
> > Hi,
> >
> > always trying to understand what's going on with my 
> application, i've 
> > monitored the "SQL Side" with MS SQL Profiler, and I'm a 
> bit surprised 
> > by results.
> >
> > The web page i'm requesting here, is a list of all the content of a 
> > table "STRUCTURE".
> >
> > Trace SQL side : 
> > ======================================================
> > declare @P1 int
> > set @P1=180150168
> > declare @P2 int
> > set @P2=4
> > declare @P3 int
> > set @P3=1
> > declare @P4 int
> > set @P4=-1
> > exec sp_cursoropen @P1 output, N'SELECT STRUCTURE.CD, STRUCTURE. 
> > STRUCTURE_CD_MERE, STRUCTURE.LA, STRUCTURE.LIB, STRUCTURE. 
> > SALARIE_CD_RESPONSABLE FROM STRUCTURE', @P2 output, @P3 output, @P4
> output
> > select @P1, @P2, @P3, @P4 
> > =======================================================
> >
> > As you can see, it's "just" a select, but after this, 
> there's a lot of 
> > "read" access on this cursor, almost 22 000 reads ! (for a list of 
> > 9778 objects)
> >
> > Like this one : ==============================================
> > exec sp_cursorfetch 180150168, 2, 1, 256
> > ==============================================
> >
> > Another important information :
> > all lists on the web side are shown with pagination system 
> (10 objects 
> > on each page), that automatically "alterate" the Criteria 
> object used 
> > adding setLimit() and setOffset() parameters. Besides, in the query 
> > shown before, I don't see those parameters on the SQL side, why ?
> >
> > Is Torque requesting the entire list and then working with cursors 
> > directly on the SQL server ??
> >
> >
> > I'm a bit disappointed with this aspect, that I don't really know ..
> >
> >
> > Thanks for all your ideas.
> > Frederic
> >
> >
> > -------- Message d'origine--------
> > De:   Thomas Fischer [mailto:fischer@seitenbau.net]
> > Date:   jeu. 20/04/2006 10:05
> > À:   Apache Torque Users List
> > Cc:
> > Objet:   RE: Still socket problems
> >
> > First of all I meant "no bug in Torque code". It is 
> probably a problem 
> > of the driver, but maybe it also depends on some database server 
> > settings,
> or
> > network problems....
> >
> >         Thomas
> >
> >
> > "KERNEUZET FREDERIC" <Frederic.Kerneuzet@pr-gicm.com> schrieb am
> 20.04.2006
> > 09:37:37:
> >
> > > Hi Thomas,
> > >
> > > what do you mean by "deeper" ? The driver level ?
> > > I agree with you, for me it's not Torque directly because 
> if i just 
> > > switch to the MS SQL Driver, everything is ok, whithout 
> any change 
> > > in my application.
> > >
> > > I'll try plain jdbc with the JTDS driver to see if the problem is 
> > > here.
> > >
> > > Thanks.
> > >
> > > -------- Message d'origine--------
> > > De:   Thomas Fischer [mailto:tfischer@apache.org]
> > > Date:   jeu. 20/04/2006 08:19
> > > À:   Apache Torque Users List
> > > Cc:
> > > Objet:   Re: RE : RE : RE : Still socket problems
> > >
> > > This problem seems to be at a deeper level that torque. 
> To find the 
> > > location of the error, have you tried to create the sql calls by 
> > > plain jdbc ?
> > >
> > >      Thomas
> > >
> > > On Wed, 19 Apr 2006, KERNEUZET FREDERIC wrote:
> > >
> > > > Just some additionnal informations to my previous email : 
> > > > =========================================================
> > > > when i try to select a user that DOESN'T exist, the request is
> > successful !
> > > > I just get my "unknown user" error (an empty list is returned by
> > torque).
> > > >
> > > > So, i think that the problem is while Torque is "receiving" data
> > > from the database server, but why ??
> > > >
> > > >
> > > > Frederic
> > > >
> > > >
> > > > -------- Message d'origine--------
> > > > De:   KERNEUZET FREDERIC
> > > > Date:   mer. 19/04/2006 11:36
> > > > À:   Apache Torque Users List
> > > > Cc:
> > > > Objet:   RE : RE : Still socket problems
> > > >
> > > > Hi,
> > > >
> > > > all my tables are owned by the same user. 
> torque.database.schema 
> > > > is set properly.
> > > >
> > > > I'm connecting using an SQL user.
> > > >
> > > > I think my Torque file configuration is good, because some 
> > > > requestare
> > OK ...
> > > >
> > > > I give you some examples : (this ones are OK) 
> > > > ==========================
> > > > 2006-04-19 11:33:10,435 DEBUG [main      ] BasePeer - SELECT
> > > MOD_GES_CON.NOM_ENTITE_MODELE, MOD_GES_CON. 
> > > TYPE_MODE_GESTION_CONFIDENTIALITE_CD FROM MOD_GES_CON
> > > > 2006-04-19 11:33:10,435 DEBUG [main      ] BasePeer - 
> Elapsed time=0
> ms
> > > > 2006-04-19 11:33:11,263 DEBUG [main      ] BasePeer - SELECT
> > > ENTITE.GROUP_ID, ENTITE.CD, ENTITE.LA, ENTITE.LIB, ENTITE. 
> > > DATE_DEBUT_VALIDITE, ENTITE.DATE_FIN_VALIDITE, ENTITE. 
> > > SALARIE_CD_RESPONSABLE, ENTITE.ENTITE_CD_MERE FROM ENTITE
> > > > 2006-04-19 11:33:11,263 DEBUG [main      ] BasePeer - 
> Elapsed time=0
> ms
> > > >
> > > > And this one is KO :
> > > > ====================
> > > > 2006-04-19 11:33:23,763 DEBUG [http8080-Processor4] BasePeer -
> > > SELECT SALARIE.USER_ID, SALARIE.CD, SALARIE.SI, SALARIE.NOM, 
> > > SALARIE.PRENOM, SALARIE.EMAIL, SALARIE.PASSWORD_VALUE, SALARIE. 
> > > CONFIRM_VALUE, SALARIE.MODIFIED, SALARIE.CREATED, SALARIE. 
> > > LAST_LOGIN, SALARIE.OBJECTDATA FROM SALARIE WHERE 
> SALARIE.CD='admin'
> > > > 2006-04-19 11:33:23,763 DEBUG [http8080-Processor4] BasePeer -
> > > Elapsed time=0 ms
> > > >
> > > >
> > > > I really don't have any idea ...
> > > >
> > > >
> > > > Frederic
> > > >
> > > >
> > > > -------- Message d'origine--------
> > > > De:   Greg Monroe [mailto:Greg.Monroe@DukeCE.com]
> > > > Date:   ven. 14/04/2006 16:38
> > > > À:   Apache Torque Users List
> > > > Cc:
> > > > Objet:   RE: RE : Still socket problems
> > > >
> > > > Below is my Torque.properties info. FYI - I set 
> maxActive higher 
> > > > for production and load testing.
> > > >
> > > > About your exceptions problems, are all the tables owned by the 
> > > > user you are connecting to the DB with?  Alternatively, 
> does the 
> > > > owner name match the one set by the "torque.database.schema" 
> > > > property in your build.properties file?  MS SQL can be 
> picky about 
> > > > this and maybe the MS driver was doing something 
> non-standard like 
> > > > looking for owner.table and then dbo.table.
> > > >
> > > > FWIW, I suggest having a common owner/db connection id and not 
> > > > setting the schema unless you need to.  It makes the 
> Torque code 
> > > > much more portable.
> > > >
> > > > Are you connecting with a SQL User or trying to use MS's net id 
> > > > authentication?  I think there may be some extra 
> parameters needed 
> > > > by jTDS in the latter case. FWIW, I don't use this, I use a 
> > > > specific SQL user (which is more portable).
> > > >
> > > > Here's my config:
> > > >
> > > > torque.database.default.adapter=mssql
> > > > torque.dsfactory.default.connection.driver = 
> > > > net.sourceforge.jtds.jdbc.Driver # ;TDS=7.0 option 
> needed for MS 
> > > > SQL 7.0 only. torque.dsfactory.default.connection.url =
> > > > jdbc:jtds:sqlserver://mssql.dukece.com:1433/dbName;TDS=7.0
> > > > torque.dsfactory.default.connection.user =  MSsqlUser
> > > > torque.dsfactory.default.connection.password = password
> > > >
> > > > # # Using commons-dbcp
> > > >
> > 
> torque.dsfactory.default.factory=org.apache.torque.dsfactory.SharedPoo
> > lD
> > > > ataSourceFactory
> > > > torque.dsfactory.default.pool.maxIdle=8
> > > > torque.dsfactory.default.pool.maxActive=10
> > > > torque.dsfactory.default.pool.testOnBorrow=true
> > > > torque.dsfactory.default.pool.validationQuery=SELECT 1
> > > >
> > > >> -----Original Message-----
> > > >> From: KERNEUZET FREDERIC 
> [mailto:Frederic.Kerneuzet@pr-gicm.com]
> > > >>
> > > >> thanks for your suggestion, i've tried to install Jtds 
> driver but 
> > > >> unsuccessfully ... Some doSelect() methods start throwing 
> > > >> exceptions (but not all ! Strange ...).
> > > >>
> > > >> Which pool do you use with your JTDS driver ? And 
> could you give 
> > > >> me some examples of your torque configuration file ?
> > > >>
> > > >
> > > > Duke CE Privacy Statement
> > > > Please be advised that this e-mail and any files 
> transmitted with
> > > it are confidential communication or may otherwise be 
> privileged or 
> > > confidential and are intended solely for the individual 
> or entity to 
> > > whom they are addressed.  If you are not the intended 
> recipient you 
> > > may not rely on the contents of this email or any 
> attachments, and 
> > > we ask that you  please not read, copy or retransmit this 
> > > communication, but reply to the sender and destroy the email, its 
> > > contents, and all copies thereof immediately.  Any unauthorized 
> > > dissemination, distribution or copying of this communication is 
> > > strictly prohibited.
> > > >
> > > >
> > > >
> > > > 
> ------------------------------------------------------------------
> > > > ---
> > > > 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
> 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message