Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coldfusion and SQL Server 2005

Status
Not open for further replies.

ice7899

Programmer
May 14, 2006
59
GB
Ive found a problem with Coldfusion and SQL Server 2005

I utilised a .sql script to create tables

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CLSFD_AdBlocks]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[CLSFD_AdBlocks](
[BlockID] [bigint] IDENTITY(1,1) NOT NULL,
[MemberID_abs] [bigint] NULL,
[SenderEmail_abs] [nvarchar](255) NULL,
[SenderIP_abs] [nvarchar](20) NULL,
CONSTRAINT [PK_CLSFD_AdBlocks] PRIMARY KEY CLUSTERED
(
[BlockID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO

This will work fine. However, if you then drop all the tables and run the script again, coldfusion will no longer connect. You get the following error

[Macromedia][SQLServer JDBC Driver]A problem occurred when attempting to contact the server (Server returned: Connection reset). Please ensure that the server parameters passed to the driver are correct and that the server is running. Also ensure that the maximum number of connections have not been exceeded for this server.

Anyone found a workaround for this?
 
Ive found a problem with Coldfusion and SQL Server 2005
This may or may not be directly related, but part of your problem may be that you keep messing with SQL Server and needlessly dropping and recreating the same tables over and over again.
According to your post in the SQL Server Forum (thread962-1281987):
...When I make changes to my table design, I tend to adjust the .sql file myself and re-execute it. (Maybe this is not a good idea?)
No, it's not a good idea to take something that works correctly, completely delete it, then recreate it over and over again. Instead of continuously running the same "DROP/CREATE" SQL Script, just create it one time and then use ALTER TABLE to change the working table's structure instead of deleting it.

That being said, when I googled your error message, this was the first result:

It appears that if you're running JRun 4, there is a bug that will cause this error with SQL Server and you need to install Updater 5 to fix it.

Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
Thanks for your help.Although it is not a good idea to needlessly drop and re-create tables, I feel that a robust server should be able to accommodate this - it is after all a basic server task.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top