I have 2 transactions, the first one has MANY updates to the table A and it finishes with a commit or rollback (ONLY AT THE END), the second one has only one insert into the table A that finishes with a commit or rollback, the problem is that the update process takes a long time to finish, and the insert process could be thrown during the first process, there's where I get everything locked cause the table A is locked and my java aplication gets stuck.
Note: When I execute each transaction independient I have no problems.
Is there any possibility to lock table A completly for the first transaction and release It for second one ??
Could you give me any suggestion of what to do step by step ?
Hi There, I was updating a Custome Error Log table in different Data Flow Task in a Package. Custom log table is being used to log the Redirect Rows which sent by a component if it has errors. So I am catching the error raised by componets and putting them all into one table. I thing this could be the cause for the following error. I am not sure Please help me out. What could be the cause of this error and how to prevent it?
SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft OLE DB Provider for SQL Server" Hresult: 0x80004005 Description: "Transaction (Process ID 71) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.".
I am build an application based on different WCF services which colect different type of data from an SQL database. I can have up to 10 clients whcih could at a certain times collect the same data as a read or right operation. I have run a test where I have only 2 clients, and I have been surprise to receive a nice error of dead lock process.
The error is as follow :
Transaction (Process ID 63) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction."
In the store procedure which I am suspected, not sure yet, I have been advise to use the
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; but no help
According to what I could notice in my application, I have one process which insert rows in this table, while clients read the same table..but I guess dead lock need to investigate in a more better way and handle it anyway...
I am not a databse administrator so I have no idea how to handle such situation.
Please help me to remove deadlock. Server Error in '/' Application.
Transaction (Process ID 69) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Transaction (Process ID 69) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
Source Error:
Line 292: da.SelectCommand.Parameters.Add(HierCode3)Line 293: Dim ds As New DataSetLine 294: da.Fill(ds, "Employees")Line 295: Con.Close()Line 296: Dim dt As DataTable = ds.Tables("Employees")
I'm having a transactional replication which replicates data every 1min.... and i got a job which runs every 15mins and pulls the reports from source db which is being replicated.
Some times when the replication is pushing the data the same time the job is trying to generate reports and as the table is being locked at the time of replication the dead lock issue is rinsing and the job is getting failed.
i am having an exe application which runs every half an hour which will do some database operations, at the same time the web application will also uses the same DB when users acces the web application. at this time i am getting Dead Lock Exception as below, to avoid this what should i do. please guide me.
System.Data.SqlClient.SqlException: Transaction (Process ID 88) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.HasMoreRows() at System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout) at System.Data.SqlClient.SqlDataReader.Read() at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping) at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at System.Data.Common.LoadAdapter.FillFromReader(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at System.Data.DataTable.Load(IDataReader reader, LoadOption loadOption, FillErrorEventHandler errorHandler) at System.Data.DataTable.Load(IDataReader reader) at B.DAL.LRQ.Select(String sLoanID) at QN.Program.QNo()
I have a table with contains Text column. and which is accessed by each page of the site. It is getting frequent Dead Lock Any body can suggest me a good solution pl.
Lets say I have table A and table B and another table AB where each row in AB refereces a row in A and a row in B. Furthermore, I set both relationships to cascade upon delete.
Then one user deletes a row from A which cascades to two rows in AB. But another user has deleted a row in B which is also trying to delete the same two rows in AB. The first transaction deletes one of the AB rows, the second deletes the other and then both transactions cannot get the other row in AB to delete because its locked. So this is a deadlock! Is it really that easy to get a dead lock?
I am using conditional split Checking to see if a record exists and if so update else insert. But this cause database dead lock any one has suggestion?
Error: The Script returned a failure result. Task SCR REIL Data failed
OnError - Task SQL Insert Error Msg Error: A deadlock was detected while trying to lock variable "System::ErrorCode, System::ErrorDescription, System::ExecutionInstanceGUID, System::StartTime, User::FEED_ID, User::t_ProcessedFiles" for read access. A lock could not be acquired after 16 attempts and timed out. Error: The expression ""EXEC [dbo].[us_sp_Insert_STG_FEED_EVENT_LOG] @FEED_ID= " + (DT_WSTR,10) @[User::FEED_ID] + ", @FEED_EVENT_LOG_TYPE_ID = 3, @STARTED_ON = '"+(DT_WSTR,30)@[System::StartTime] +"', @ENDED_ON = NULL, @message = 'Package failed. ErrorCode: "+(DT_WSTR,10)@[System::ErrorCode]+" ErrorMsg: "+@[System::ErrorDescription]+"', @FILES_PROCESSED = '" + @[User::t_ProcessedFiles] + "', @PKG_EXECUTION_ID = '" + @[System::ExecutionInstanceGUID] + "'"" on property "SqlStatementSource" cannot be evaluated. Modify the expression to be valid.
Warning: The Execution method succeeded, but the number of errors raised (4) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
And how did I get 4 errors? - I only set my script task result to failure
Hi We are facing an acute situation in our web-application. Technology is ASP.NEt/VB.NET, SQL Server 2000.
Consider a scenario in which User 1 is clicking on a button which calls a SQL stored procedure. This procedure selects Group A of records of Database Page1.
At the same time if User 2 also clicks the same button which calls same SQL stored procedure. This procedure selects Group B of records of Database Page1.
So, its the same Page1 but different sets of records. At this moment, both the calls have shared locked on the Page1 inside the procedure.
Now, in call 1, inside the procedure after selecting Group A of records, the next statement is and update to those records. As soon as update statement executes, SQL Server throws a deadlock exception as follows :
Transaction (Process ID 78) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction
We are able to understand why its happening. Its because, Group A and Group B of records are on the same Page1. But both the users have shared lock on the Page1. So, no one gets the exclusive lock in records for update, even though, the records are different.
How can I resolve this issue? How can I get lock on wanted rows instead of entire page?
Hi, I have set of 2 DTS packages, one of which calls the other by forming a command-line (dtexec) using a Execute Process task.
From the parent package-> Execute Process Task-> dtsexec /F etc... /<pkg variable> = "servername"
Each of the parent and the called package have a variable: "User::DWServerSQLInstance" which is mapped to the SQL server connection manager server name property using an expression. The outer package has the above variable and so does the inner called package (which gets assigned through the command line from the outerpackage call to inner)
I "sometimes" get the following error:
OnError,I4,TESTDOMAdministrator,ACDWAggregation,{A1F8E43F-15F1-4685-8C18-6866AB31E62B},{77B2F3C7-6756-46EB-8C01-D880598FB4B3},5/22/2006 5:10:28 PM,5/22/2006 5:10:28 PM,-1073659822,0x,The variable "User::DWServerSQLInstance" is already on the read list. A variable may only be added once to either the read lock list or the write lock list.
Help would be appreciated!
I have seen other posts on this but, not able to relate the solution to my scenario.
Package works fine when run from BIDS, DTExec, dtexecui. When I schedule it, It get these random errors. (See below)
The main culprit is a variable called "RecordsetFileDIR" which is set using an expression. (@[User::_ROOT] + "RecordSets\")
A number of other variables use this as part of their expression and as they all fail, pretty much everything dies.
I have installed SP1 (Not Beta) on server. Package uses config files to set the value of _ROOT.
The error does not always seem to be with this particular variable though. Always a variable that uses an expression but errors are random. Also, It will run 3 out of 10 times without a problem. I am the only person on the server at the time.
Any ideas?
Cheers,
Crispin
Error log:
OnError,,,POSBasketImport,,,10/05/2006 12:03:34,10/05/2006 12:03:34,-1073659822,0x,The variable "User::RecordsetFileDIR" is already on the read list. A variable may only be added once to either the read lock list or the write lock list.
OnError,,,POSBasketImport,,,10/05/2006 12:03:34,10/05/2006 12:03:34,-1073639420,0x,The expression for variable "rsHeaderFile" failed evaluation. There was an error in the expression.
OnError,,,DF_Header_Header,,,10/05/2006 12:03:34,10/05/2006 12:03:34,-1071636247,0x,Accessing variable "User::rsHeaderFile" failed with error code 0xC00470EA.
OnError,,,Move All Data,,,10/05/2006 12:03:34,10/05/2006 12:03:34,-1071636247,0x,Accessing variable "User::rsHeaderFile" failed with error code 0xC00470EA.
OnError,,,Load Open Batches and Process Files,,,10/05/2006 12:03:34,10/05/2006 12:03:34,-1071636247,0x,Accessing variable "User::rsHeaderFile" failed with error code 0xC00470EA.
OnError,,,POSBasketImport,,,10/05/2006 12:03:34,10/05/2006 12:03:34,-1071636247,0x,Accessing variable "User::rsHeaderFile" failed with error code 0xC00470EA.
OnError,,,DF_Header_Header,,,10/05/2006 12:03:34,10/05/2006 12:03:34,-1071636390,0x,The file name is not properly specified. Supply the path and name to the raw file either directly in the FileName property or by specifying a variable in the FileNameVariable property.
OnError,,,Move All Data,,,10/05/2006 12:03:34,10/05/2006 12:03:34,-1071636390,0x,The file name is not properly specified. Supply the path and name to the raw file either directly in the FileName property or by specifying a variable in the FileNameVariable property.
OnError,,,Load Open Batches and Process Files,,,10/05/2006 12:03:34,10/05/2006 12:03:34,-1071636390,0x,The file name is not properly specified. Supply the path and name to the raw file either directly in the FileName property or by specifying a variable in the FileNameVariable property.
OnError,,,POSBasketImport,,,10/05/2006 12:03:34,10/05/2006 12:03:34,-1071636390,0x,The file name is not properly specified. Supply the path and name to the raw file either directly in the FileName property or by specifying a variable in the FileNameVariable property.
OnError,,,DF_Header_Header,,,10/05/2006 12:03:34,10/05/2006 12:03:34,-1073450901,0x,"component "rsHeader" (365)" failed validation and returned validation status "VS_ISBROKEN".
OnError,,,Move All Data,,,10/05/2006 12:03:34,10/05/2006 12:03:34,-1073450901,0x,"component "rsHeader" (365)" failed validation and returned validation status "VS_ISBROKEN".
OnError,,,Load Open Batches and Process Files,,,10/05/2006 12:03:34,10/05/2006 12:03:34,-1073450901,0x,"component "rsHeader" (365)" failed validation and returned validation status "VS_ISBROKEN".
OnError,,,POSBasketImport,,,10/05/2006 12:03:34,10/05/2006 12:03:34,-1073450901,0x,"component "rsHeader" (365)" failed validation and returned validation status "VS_ISBROKEN".
There are 2 tables for transaction. The header and tail tables. How do I insert records. if one is updated & another is not ? the sequence for tracking the records will fail. How do I deadlock the table for insert especially when I use stored procedures for 'Inserts'.
It's been pretty quiet on here recently - no-one experiencing any corruption problems we haven't already given guidance on? Cool...
Paul Randal Lead Program Manager, Microsoft SQL Server Storage Engine + SQL Express (Legalese: This posting is provided "AS IS" with no warranties, and confers no rights.)
I have a Orders table, this has a Primary key on one Column ( OrderID )
We are using a Stored Proc to insert data into this table ( I am not starting the Transaction in the stored Proc ) as its controlled by the front end written in C++.
when ever there is a update on this Orders table I move the record to the ordershistory table. ( I have a trigger in the CTOrders table on INSERT and UPDATE )
The C++ App does an Async I/O. Offlate the App is experiencing a few dead locks during the day espicially at the market open and Close as this database is for the Trading System.
I have a SQL Server 2005 system that has been running for about 2 years. This morning nothing will connect. SQL Server Agent will not start. It gives me the message
"The request failed or the Service did not respond in a timely manner. Consult the event log or other applicable error logs."
The error log only states the SQL Server Agent cannot connect to server CANSPEC-TMMCSQLDEV and it is shutting down.
When i try to logon to SQL Server using Management Studio i get the following message:
"A connection was successfully established with the server, but then an error occured during the pre-logon handshake. Provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe. Microsoft SQL Server Error : 233"
The help for this error states that it could be caused by the fact that SQL Server does not allow remote connections. I have remote connections turned on.
Microsoft products that are doing well tend to have very strong communities around them, and I am starting to get a bit disappointed with SQL-CLR. This forum seems fairly light, the links int he FAQ are broken, and the official SQL-CLR blog has no update since 2006..
Taking all of that into account I am forced to wonder, Is this a dead subject?
I am not trying to say that the people in this forum are doing something wrong, nor am i claiming that no one uses SQL-CLR (i am a user, thats why im here). But I did want to get the opinion of the group here of where they think this concept stands.
I think SQL-CLR can really be a good tool in the chest for various scenarios. I am for one using it to have a generic SQL-CLR Stored Procedure that can analyze small sets of data and move it into various buckets depending on validation rules built into the code. So far its working very well, but I admit it has not yet hit production so only time will tell. (Performance is always a concern of mine)
HP Proliant DL385 G1, 142*6 GB AMD Opteron „¢ Processor 280, 2.40 GHz 4.00 GB RAM, DVD ROM Win2K3 R2, SP1 64bit
SQL Server Details:
SQL Server 2000 Enterprise Edition 32bit Service Pack4
Network Details:
Clients can access the server by Terminal Server and also by Direct Connectivity. The connectivity is provided by RF network Provider.
Application Details:
Application was designed by Power Builder 6.5.
Error Details: If I divide my clients connectivity to the server then it is divided into 3 types
TYPE A >> Users inside my LAN using a DNS server they give the server name in their Parameter file to connect to the Database Server.
TYPE B >> Users who are in WAN connect to the server by Terminal Servers for Data Input. Terminal Servers are inside my LAN.
TYPE C >> Users who are in WAN connect to the Server by Direct Connection for Reports and Print Out they give the IP address of the Database server directly in their Parameter files.
After every 6 to 7 days the ERROR DB Processes Dead comes to the TYPE C. The error Numbers are 100025 and 100005.
At the same time TYPE A AND TYPE B are not getting any errors.
For further diagnosis I have taken a client machine to Net Meeting and taken his desktop in control. I have connected the client machine to the database server by ISQL in command prompt.
From Backend I can see that the SQL server has allocated a SPID to the client machine. After I have executed
1>SELECT * FROM SYSDATABASES 2>GO
It will return me all data but it will not show me how many rows selected or EOF.
After some time it will give me the prompt (3>) but without EOF and after that if I give another query then it will give the below error
DB-Library: Attempt to initiate a new SQL Server Operation with results pending.
DB-Library: Unexpected EOF from SQL Server. General Network Error. Check Your Documentation. Net-Library error 10054: ConnectionCheckForData (CheckForData()) DB-Library: DBPROCESSES is dead or not enabled. DB-Library: DBPROCESSES is dead or not enabled. DB-Library: DBPROCESSES is dead or not enabled. DB-Library: DBPROCESSES is dead or not enabled.
At the same time if I give IP address of another server then it works and TYPE A and TYPE B don€™t get any problem.
To stop this error I have to restart the server after that for again seven days it works and again the same problem.
I cant find anything I have checked tempdb, cache size but it is normal no abnormal activities.
I want to lock a table so others cannot lock it but able to read it inside transactions.
The coding I need is something like this: set implicit_transactions on begin transaction select * from table1 with (tablock, holdlock) update table2 set field1 = 'test' commit transaction commit transaction
I have tried the coding above, it won't prevent others from locking table1.
So, I changed the tablock to tablockx to prevent others from locking table1. But this will also prevent others from reading table1. So, how can I lock table1 so others cannot lock it but still able to read it?
We are running application on Ms SQL Server connecting to PowerBuilder 7.0.3, using MSS Microsoft SQL Server 6.X driver. We have recently migrated the SQL Server from 2000 to 2005 SP2, in which databases are still at compatability level 80. The application runs perfectly for one week, but later we received some occassional reports from users that database connection breaks after a
certain idle period. Below are the errors, usually error 1 appears before error 2.
Error 1 A database error has occured. Database error code: 10025 Database error message: Select error: Possible network error: Write to SQL Server Failed. General network error. Check your documentation.
Error 2 A database error has occured. Database error code: 10005 Database error message: Select error: DBPROCESS is dead or not enabled.
We couldn't find any related errors in the SQL Server log. Does anyone has the idea of what's wrong or how to trace the connection brokerage?
I set up a table, job and alert as described in this article on msdn: http://msdn2.microsoft.com/en-us/library/ms186385.aspx
The alert is working fine but the job is failing with the following info: Message Unable to start execution of step 1 (reason: Variable WMI(TextData) not found). The step failed.
The info does seem to be posted in the log which is not where I wanted it. Anyone have any ideas what I have not got set up correctly? I have the trace on and works since the info goes to the log, but I would like it in the database not in the log.
Any help would be appreciated. Thanks
Linda Leslie Academic Information Technology & Libraries University of Cincinnati
Any help is sincerely appreciated:I have data in a table that represents the following:Admin Visit Type Registration Date Discharge Date D 20050301 20050301D 20050301 20050301W 20050301 20050301E 20050301 20050301D 20050301 20050302W 20050301 20050303W 20050301 20050311D 20050301 20050301Patient Type is always and I for the records I want but there are also Patient Types = O which I don't care about..What I would like to do is accoumlate a counter on the number of Registrations per date as well as Discharges per date.There can be thousands of registrations per day as well as thousands of discharges per day. So lets say I want to pass a date parameter to accumulate the total registrations and discharges per day. I have beat my head against the desk for the last two days because I believe this is a simple query but I just cannot get the results I want - so any help is greatly appreciated. I have written the following sql but I do not get a sum of the total registrations and discharges and EXPR3 and Expr4 always equal each other which is not the case . For example on 20040301 I have 88 registrations and 17 discharges but I can't ever get the correct totals...I wrote the following in Query Analyzer - but it does not work and I have went around in circles and have tried so many things I am just frustrated.........Declare @Parm_Beg_Date as nvarchar(8)Set @Parm_Beg_Date = 20040313 SELECT Patient_Visit_Result_Master.PVR_Admin_Visit_Type,Patient_Visit_Result_Master.PVR_Patient_Type, Patient_Visit_Result_Master.PVR_Registration_Date,Patient_Visit_Result_Master.PVR_Discharge_Date, Count(Distinct(Patient_Visit_Result_Master.PVR_Registration_Date)) as Expr3,Count(Distinct(Patient_Visit_Result_Master.PVR_Discharge_Date)) as Expr4 FROM Patient_Visit_Result_Master INNER JOINPatient_Visit_Result_Master Patient_Visit_Result_Master_1 ON Patient_Visit_Result_Master.PVR_Hospital_ID = Patient_Visit_Result_Master_1.PVR_Hospital_ID AND @Parm_Beg_Date = Cast(Patient_Visit_Result_Master_1.PVR_Registration_Date as nvarchar(8))or@Parm_Beg_Date = Cast(Patient_Visit_Result_Master_1.PVR_Discharge_Date as nvarchar(8)) WHERE (Patient_Visit_Result_Master.PVR_Admin_Visit_Type = 'E') AND (Patient_Visit_Result_Master.PVR_Patient_Type = 'I') AND (Cast(Patient_Visit_Result_Master.PVR_Registration_Date as nvarchar(8)) = @Parm_Beg_Date) OR (Patient_Visit_Result_Master.PVR_Admin_Visit_Type = 'D') AND (Patient_Visit_Result_Master.PVR_Patient_Type = 'I') AND (Cast(Patient_Visit_Result_Master.PVR_Registration_Date as nvarchar(8)) = @Parm_Beg_Date) Or (Patient_Visit_Result_Master.PVR_Admin_Visit_Type = 'W') AND (Patient_Visit_Result_Master.PVR_Patient_Type = 'I') and (Cast(Patient_Visit_Result_Master.PVR_Discharge_Date as nvarchar(8)) = @Parm_Beg_Date) Or (Patient_Visit_Result_Master.PVR_Admin_Visit_Type = 'D') AND (Patient_Visit_Result_Master.PVR_Patient_Type = 'I') and (Cast(Patient_Visit_Result_Master.PVR_Discharge_Date as nvarchar(8)) = @Parm_Beg_Date) GROUP BY Patient_Visit_Result_Master.PVR_Admin_Visit_Type,Patient_Visit_Result_Master.PVR_Patient_Type, Patient_Visit_Result_Master.PVR_Registration_Date,Patient_Visit_Result_Master.PVR_Discharge_Date Order By Patient_Visit_Result_Master.PVR_Admin_Visit_TypeThanks in advance
Our web forms have suddenly become dead slow.We use these forms to update certain tables.Both web serever and db servers are on different boxes. Db server seems to be working fine with no blocking and all other scheduled jobs are running in time on the db server.So what could be the reason??We even increased the default time out for these web forms but still getting the slow response or some times time out again. Sheila.