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 Bill Tomlinson <ws...@gmail.com> on 2007/01/19 20:54:10 UTC

Is SQL Server 2005 supported in Torque?

I've read the faqs and docs, but I can't find a page where the 2005
version of SQL server is explicitly mentioned.

Short question: is SQL Server 2005 supported, and if so, what driver do I use?

Long details:

We have an older application using an older version of Torque and the
2000 version of SQL Server and using an older version of the SQL
Server JDBC driver from Microsoft. For various reasons we want to
switch to 2005.

I changed the connection url to the new database server (with 2005)
and I got this error which, to be honest, doesn't mean much to me:

FATAL ERROR: Problem connecting with database.([Microsoft][SQLServer JDBC Driver
][SQLServer]The incoming tabular data stream (TDS) remote procedure call (RPC) p
rotocol stream is incorrect. Parameter 1 (""): Data type 0x38 is unknown.)

So it's either our application, torque, or the quite old jdbc driver.

On the assumption that it is the jdbc driver, I downloaded the latest
SQL server jdbc driver from Microsoft and tried to run that. But I got
this error:

FATAL ERROR: Problem connecting with database.(Unknown JDBC driver: com.microsof
t.sqlserver.jdbc.SQLServerDriver: Check your configuration file)

Which I understand to mean that the driver isn't one that Torque
supports (Microsoft changed the package for the driver from the older
driver).

I checked the source code for DBFactory, and the trunk HEAD version
doesn't have this driver either. So am I correct that even the latest
version of Torque doesn't support the latest MS jdbc drivers?

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


Re: Is SQL Server 2005 supported in Torque?

Posted by Ivor Clarke <iv...@skylist.com>.
We are using Torque 3.1 with the JTDS 1.1 driver and have several  
production deployments based on SQLServer 2005 (along with others in  
SQLServer 2000 and MySQL 4.1) and Torque has worked perfectly well  
for us.  Our application makes extensive use of Torque, uses a pretty  
large portion of its feature set and in some cases uses  
VillageRecords directly.  The production environment where we're  
using SQLServer involves ~100MM transactions per day, so I feel  
pretty confident saying you shouldn't se any issues.

Sincerely,
Ivor Clarke
Vice President
Skylist, a Datran Media Company

On Jan 21, 2007, at 2:42 AM, Thomas Vandahl wrote:

> Greg Monroe wrote:
>> The newest version has been tested against MS SQL 2000 (and
>> MS SQL V7) but not specifically against MS SQL 2005.  Mainly
>> because none of the developers has easy access to it. (I.e.,
>> I didn't DL the developer edition and install it somewhere.
>> ;) )
>
> Actually, I installed the free edition of SQL-Server 2005 and ran the
> tests while fixing that LargeSelect/limit problem. Worked fine.
>
> Bye, Thomas.
>
> ---------------------------------------------------------------------
> 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: Is SQL Server 2005 supported in Torque?

Posted by Thomas Vandahl <tv...@apache.org>.
Greg Monroe wrote:
> The newest version has been tested against MS SQL 2000 (and
> MS SQL V7) but not specifically against MS SQL 2005.  Mainly
> because none of the developers has easy access to it. (I.e.,
> I didn't DL the developer edition and install it somewhere.
> ;) )

Actually, I installed the free edition of SQL-Server 2005 and ran the
tests while fixing that LargeSelect/limit problem. Worked fine.

Bye, Thomas.

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


Re: Is SQL Server 2005 supported in Torque?

Posted by Bill Tomlinson <ws...@gmail.com>.
On 1/19/07, Greg Monroe <Gr...@dukece.com> wrote:
> But AFAIK, there are no major changes in MS SQL that would
> prevent Torque from working with it. Unless it's because MS
> has done a major split with the SQL standards, we'll try to
> fix any problems reported.
>
> So the answer to the "Is it supported?" question is a
> qualified yes.

Okay, that's good. With Will's information and yours I feel confident
enough to proceed. I'll upgrade to the latest version of Torque and
try the various drivers and configuration settings and see if I can
tame Redmond's new beast.

I'd like to thank the group for their help on this (and particularly
the speed of response).

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


RE: Is SQL Server 2005 supported in Torque?

Posted by Greg Monroe <Gr...@DukeCE.com>.
What Thomas meant by extensions is that there has been a 
lot of changes to Torque relating to MS SQL over the last
year or so.  

The newest version has been tested against MS SQL 2000 (and
MS SQL V7) but not specifically against MS SQL 2005.  Mainly
because none of the developers has easy access to it. (I.e.,
I didn't DL the developer edition and install it somewhere.
;) )

But AFAIK, there are no major changes in MS SQL that would 
prevent Torque from working with it. Unless it's because MS 
has done a major split with the SQL standards, we'll try to 
fix any problems reported.

So the answer to the "Is it supported?" question is a 
qualified yes.

That said, here's some thoughts:

Unless you REALLY need to use MS's JDBC driver, I'd suggest 
using the jTDS JDBC driver (http://jtds.sourceforge.net/).
This is what we test with and it is known to be fully 
JDBC 4.0 compliant and well used in lots of production 
situations (we use it here).  See the MS SQL Database HOW 
TO for syntax, etc.

If you're updating from a Torque from before 3.1, there 
have been a lot of changes in the Torque property settings, 
both for the generation and runtime.  You will probably 
need to look closely at your old properties file to make 
sure you are using the same settings.

Good luck and feel free to ask questions here.

> -----Original Message-----
> From: Bill Tomlinson [mailto:wstomlin@gmail.com] 
> Sent: Friday, January 19, 2007 4:40 PM
> To: Apache Torque Users List
> Subject: Re: Is SQL Server 2005 supported in Torque?
> 
> On 1/19/07, Thomas Vandahl <tv...@apache.org> wrote:
> > >> But it does sound like SQL server 2005 is not an officially 
> > >> supported DB for the project.
> >
> > Well, you did not even say which Torque version you use. 
> 3.3 contains 
> > some MS specific extensions...
> >
> 
> I apologize for being obtuse, but I don't understand what 
> "contains some MS specific extensions..." exactly means?
> 
> Is SQL server 2005 supported in the latest release (3.3) or 
> not? If someone involved in the project says "yes" then I'll 
> dig in there and do whatever work I need to do to make it work.
> 
> I'm just asking because a) 2005 is not mentioned explicitly 
> on any Torque page I could find (and 2000 is) and b) the hard 
> coding of driver names in DBFactory suggests that some 
> drivers are supported and some aren't.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 

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


Re: Is SQL Server 2005 supported in Torque?

Posted by Bill Tomlinson <ws...@gmail.com>.
On 1/19/07, Thomas Vandahl <tv...@apache.org> wrote:
> >> But it does sound like SQL server 2005 is not an officially supported
> >> DB for the project.
>
> Well, you did not even say which Torque version you use. 3.3 contains
> some MS specific extensions...
>

I apologize for being obtuse, but I don't understand what "contains
some MS specific extensions..." exactly means?

Is SQL server 2005 supported in the latest release (3.3) or not? If
someone involved in the project says "yes" then I'll dig in there and
do whatever work I need to do to make it work.

I'm just asking because a) 2005 is not mentioned explicitly on any
Torque page I could find (and 2000 is) and b) the hard coding of
driver names in DBFactory suggests that some drivers are supported and
some aren't.

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


Re: Is SQL Server 2005 supported in Torque?

Posted by Thomas Vandahl <tv...@apache.org>.
Will Glass-Husain wrote:
> I'm a little surprised the JDBC driver class is hard coded in torque.
> (I'm not really a Torque maven).  Can some one else comment?  Is
> setting the adapter a substitute for Torque auto-recognizing the
> driver class?

This is not the recommended method to configure Torque although setting
a driver Torque knows about is indeed a possible way to select a
database adapter. However you can add any driver you want and even roll
your own adapter if you like/must.

>> But it does sound like SQL server 2005 is not an officially supported
>> DB for the project.

Well, you did not even say which Torque version you use. 3.3 contains
some MS specific extensions...

Bye, Thomas.


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


Re: Is SQL Server 2005 supported in Torque?

Posted by Will Glass-Husain <wg...@forio.com>.
Bill,

Actually, despite my long email, it wasn't really difficult.  I just
needed to use the right JDBC driver, JDBC url, and driver class name.
The other issues had to do with auto-generating the SQL schema.

I did not patch DBFactory.  Didn't occur to me. I set the adapter
property to "mssql" and it just worked.

I'm a little surprised the JDBC driver class is hard coded in torque.
(I'm not really a Torque maven).  Can some one else comment?  Is
setting the adapter a substitute for Torque auto-recognizing the
driver class?

WILL

On 1/19/07, Bill Tomlinson <ws...@gmail.com> wrote:
> On 1/19/07, Will Glass-Husain <wg...@forio.com> wrote:
> > Hi,
> >
> > I just moved a torque app (v 3.0) from MySQL to SQL Server 2005 this
> > week.  (I'd previously also run this with SQL Server 2000, so I had a
> > little experience).  Some notes...
>
> Thanks a lot for your reply. So I guess it can be done with some work.
>
> But it does sound like SQL server 2005 is not an officially supported
> DB for the project.
>
> And I'm still confused about the driver issue. The new MS jdbc driver
> is not listed in DBFactory, right? see:
>
> http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBFactory.java?view=markup
>
> The old driver is in there
> (com.microsoft.jdbc.sqlserver.SQLServerDriver)
>
> But the new driver isn't
> (com.microsoft.sqlserver.jdbc.SQLServerDriver)
>
> Did you have to patch DBFactory? Or am I misreading the code.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
>


-- 
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

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


Re: Is SQL Server 2005 supported in Torque?

Posted by Bill Tomlinson <ws...@gmail.com>.
On 1/19/07, Will Glass-Husain <wg...@forio.com> wrote:
> Hi,
>
> I just moved a torque app (v 3.0) from MySQL to SQL Server 2005 this
> week.  (I'd previously also run this with SQL Server 2000, so I had a
> little experience).  Some notes...

Thanks a lot for your reply. So I guess it can be done with some work.

But it does sound like SQL server 2005 is not an officially supported
DB for the project.

And I'm still confused about the driver issue. The new MS jdbc driver
is not listed in DBFactory, right? see:

http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBFactory.java?view=markup

The old driver is in there
(com.microsoft.jdbc.sqlserver.SQLServerDriver)

But the new driver isn't
(com.microsoft.sqlserver.jdbc.SQLServerDriver)

Did you have to patch DBFactory? Or am I misreading the code.

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


Re: Is SQL Server 2005 supported in Torque?

Posted by Will Glass-Husain <wg...@forio.com>.
Hi,

I just moved a torque app (v 3.0) from MySQL to SQL Server 2005 this
week.  (I'd previously also run this with SQL Server 2000, so I had a
little experience).  Some notes...

I downloaded the latest version of the Microsoft JDBC driver.  After
some gnashing of teeth, I realized that the driver class and JDBC URL
format have changed from the earlier JDBC.  My setup...

torque.dsfactory.broadcast.connection.user = user
torque.dsfactory.broadcast.connection.password = test
torque.database.broadcast.adapter=mssql
torque.dsfactory.broadcast.connection.url =
jdbc:sqlserver://localhost:3249;DatabaseName=broadcast_test
torque.dsfactory.broadcast.pool.validationQuery=SELECT 1
torque.dsfactory.broadcast.connection.driver =
com.microsoft.sqlserver.jdbc.SQLServerDriver

A couple of changes from earlier versions of the JDBC driver:
* In the past the URL has needed ";SelectMethod=cursor" but I left it
off and it seemed to work.
* In the past you need to set SQL server to work with Windows or
user/password authentication.  Both are now supported (there's a DLL
to install if you want to use Windows authentication)
* Apparently the port has changed from 1433 to 3249.  Maybe it's
better to not even specify this.

And some potential bugs/issues
* When generating SQL with idmethod set to native, the identity column
was not correctly generated.  I had to set the autoIncrement="true" on
each individual primary key column.

* Then, in order to insert data for tables with identity columns, I
had to tweak the SQL template as follows.  (required in order to
insert a row with an primary key).  I'm using an older version of
Torque, not sure if this is exactly applicable

Index: C:/Documents and Settings/wglass/My
Documents/Workspace/internal/broadcast2/build/templates/sql/load/mssql/row.vm
===================================================================
--- C:/Documents and Settings/wglass/My
Documents/Workspace/internal/broadcast2/build/templates/sql/load/mssql/row.vm	(revision
443)
+++ C:/Documents and Settings/wglass/My
Documents/Workspace/internal/broadcast2/build/templates/sql/load/mssql/row.vm	(revision
468)
@@ -1,4 +1,12 @@
+
+#set($hasIdentity = false)
+#foreach($col in $row.ColumnValues)#set($hasIdentity = $hasIdentity
|| $col.Column.autoIncrement)#end
+#if($hasIdentity)
+SET IDENTITY_INSERT $row.Table.Name ON;
+#end
 INSERT INTO $row.Table.Name (##
 #set ($comma="")#foreach($col in
$row.ColumnValues)$comma${col.Column.Name}#set($comma=",")#end)
     VALUES (#set ($comma="")#foreach($col in
$row.ColumnValues)$comma${generator.parse("sql/load/mssql/val.vm", "",
"column", $col)}#set ($comma=",")#end);
-
+#if($hasIdentity)
+SET IDENTITY_INSERT $row.Table.Name OFF;
+#end

WILL

On 1/19/07, Bill Tomlinson <ws...@gmail.com> wrote:
> I've read the faqs and docs, but I can't find a page where the 2005
> version of SQL server is explicitly mentioned.
>
> Short question: is SQL Server 2005 supported, and if so, what driver do I use?
>
> Long details:
>
> We have an older application using an older version of Torque and the
> 2000 version of SQL Server and using an older version of the SQL
> Server JDBC driver from Microsoft. For various reasons we want to
> switch to 2005.
>
> I changed the connection url to the new database server (with 2005)
> and I got this error which, to be honest, doesn't mean much to me:
>
> FATAL ERROR: Problem connecting with database.([Microsoft][SQLServer JDBC Driver
> ][SQLServer]The incoming tabular data stream (TDS) remote procedure call (RPC) p
> rotocol stream is incorrect. Parameter 1 (""): Data type 0x38 is unknown.)
>
> So it's either our application, torque, or the quite old jdbc driver.
>
> On the assumption that it is the jdbc driver, I downloaded the latest
> SQL server jdbc driver from Microsoft and tried to run that. But I got
> this error:
>
> FATAL ERROR: Problem connecting with database.(Unknown JDBC driver: com.microsof
> t.sqlserver.jdbc.SQLServerDriver: Check your configuration file)
>
> Which I understand to mean that the driver isn't one that Torque
> supports (Microsoft changed the package for the driver from the older
> driver).
>
> I checked the source code for DBFactory, and the trunk HEAD version
> doesn't have this driver either. So am I correct that even the latest
> version of Torque doesn't support the latest MS jdbc drivers?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
>


-- 
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

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