SERIALIZABLE TRANSACTION Getting Blocked?

Jun 10, 2004

Hi guys,

I have a stored procedure which generates the next sequence number...
it uses SERIALIZABLE Option. procs look something like below..

begin
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
BEGIN TRANSACTION

Sequence generating statement...

COMMIT TRANSACTION
set @NextSequenceValue = @NextSequenceValue
Return @NextSequenceValue
end

For some reason when i call the proc with below parameters to get next sequence number.. its hungs up..


declare @NextSequenceValue int
set @NextSequenceValue = 0
exec spGetNextSequence 19, 'LotSequence', @NextSequenceValue output, Null
select @NextSequenceValue as NextSequenceValue


When i queried sp_who2 it shows that my processid is blocked by some other processid.. and when i do DBCC INPUTBUFFER (blockingprocessid), the query of blocking processid and my nextsequence generation stored proc is not realted at all..

Can you help shed some light on why my nextsequence generating proc is getting hunged...?

help is appericated..

View 4 Replies


ADVERTISEMENT

Blocked Transaction Problem

Oct 11, 2006

Hello,

I am trying to execute next query, but when doing it, TABLE1 locks and it does not finish.

SERVER2 is a linked server.

BEGIN TRAN
INSERT INTO TABLE1
SELECT * FROM SERVER2.DATABASE2.DBO.TABLE2 WHERE TAB_F1 IS NULL
COMMIT TRAN

I have same configuration in other 2 computers and it works ok.

What is the problem?

Thank you!!

View 8 Replies View Related

Long Blocked Transaction Logging

May 5, 2007

Is there anyone know any feature in SQL server which can detect/log the transaction which has been blocked unusually long? My idea is:



If a transaction has run for over 30 minutes, then log the following information in SQL server log:

1. State of the transaction : Blocked, Running, Sleeping

2. Time happeing

3. Duration

4. Last SQL it run

5. Blocked by which thread and info of the thread : the last SQL it run, the state of the thread.



Possibly it would be run in SQL server agent or SQL profiler has such feature, I am not sure about it. Can anyone suggest? Thanks.

View 4 Replies View Related

URGENT: Insert And Update In A Transaction Is Getting Blocked

Dec 2, 2005

Hello,

View 25 Replies View Related

Isolation Level Serializable

Jul 4, 2005

Hi all,
can anyone give me more information on
set transaction isolation level serializable ?? I want to prove some lock to use on online insert and update.
Thank you every much.

View 14 Replies View Related

Serializable Transactions And Insert.

Jul 23, 2005

Hi,I have a problem using serializable transactions. In one transaction Iselect a single specific row from a table using a where clause (thiscauses it to acquire and hold a range lock). In another transaction Iattempt to insert a new row into the table (which does not match thefirst transactions where clause), but it is blocked by the firsttransaction. The reading I have done on SQL Server suggests that Ishould be able to insert rows, as long as the new rows do not match thewhere clause in the other transactions select.Here is what I do:Transaction 1SET TRANSACTION ISOLATION LEVEL SerializableBEGIN TRANSACTIONselect * from test_table where id=1;and then on another session I runTransaction 2SET TRANSACTION ISOLATION LEVEL SerializableBEGIN TRANSACTIONinsert into test_table values (2, 'two');Transaction 2 cannot complete until transaction 1 has finished. I havetried using WITH (ROWLOCK) hints but to no avail. Am I missingsomething important? Is this true of other DBs?(I am able to update rows that are not in transaction 1's where clause)I am using SQL Server version 8.00.760(SP3).Thanks for your help,Magnus.

View 3 Replies View Related

SERIALIZABLE Locks Inside A Trigger?

Oct 25, 2001

I have an insert trigger which has to insert new records into 2 other databases. The first thing it has to do is get a maxid from a table in each of the databases before the insert. i was going to use a SET TRANSACTION ISOLATION LEVEL SERIALIZABLE statment before getting the ID and then do my insert. My question is two-fold, first is this the best way to do it. And since I have 2 separate selects to get the 2 maxids in the other 2 databases and tables, do I need 2 of these statements inside the trigger, before each insert, or a separate one for each select?
Thanks

View 2 Replies View Related

Serializable Read And Lock Mode

Jul 20, 2005

Hi,Version Info: SQLSERVER 2000 SP3I am trying to understand how SQL Server works with SERIALIZABLE read.I am fairly new to SQL Server, having mainly worked with Informix.We are getting lock timeout error in our application. Our lock timeoutis set to 20 seconds. I am trying to investigate why locks are held forsuch a long time in the first place.I believe SQLServer tries to put keylocks as much as possible forensuring serializibility. For e.g.SELECT column_bfrom table_awhere column_c between 1000 and 1100what if column_c has no index. Does it switch over the data row.And what if a table has no index. Will it go for table lock, as ituse to do in earlier versions.TIA.--email id is bogus

View 3 Replies View Related

SQL Server 2005 JDBC Driver V1.2: StreamError Not Serializable

Jan 11, 2008

I'm encountering a problem that seems to be due to the StreamError class not being serializable. This was raised on the JDBC Driver Team blog by Jonas on 10/24/2007. Jimmy Wu notes on 10/29/2007 that it is under investigation. Any progress?

http://blogs.msdn.com/jdbcteam/archive/2007/10/12/microsoft-sql-server-2005-jdbc-driver-v1-2-official-release.aspx#comments

Thanks,
Mike

View 2 Replies View Related

Error 8525: Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction.

May 31, 2008

Hi All

I'm getting this when executing the code below. Going from W2K/SQL2k SP4 to XP/SQL2k SP4 over a dial-up link.

If I take away the begin tran and commit it works, but of course, if one statement fails I want a rollback. I'm executing this from a Delphi app, but I get the same from Qry Analyser.

I've tried both with and without the Set XACT . . ., and also tried with Set Implicit_Transactions off.

set XACT_ABORT ON
Begin distributed Tran
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.TRANSACTIONMAIN
set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.TRANSACTIONMAIN
set REPFLAG = 0 where REPFLAG = 1 and DONE = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.WBENTRY
set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.WBENTRY
set REPFLAG = 0 where REPFLAG = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.FIXED
set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.FIXED
set REPFLAG = 0 where REPFLAG = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.ALTCHARGE
set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.ALTCHARGE
set REPFLAG = 0 where REPFLAG = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.TSAUDIT
set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.TSAUDIT
set REPFLAG = 0 where REPFLAG = 1
COMMIT TRAN


It's got me stumped, so any ideas gratefully received.Thx

View 1 Replies View Related

SSIS, Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction.

Feb 22, 2007

I have a design a SSIS Package for ETL Process. In my package i have to read the data from the tables and then insert into the another table of same structure.

for reading the data i have write the Dynamic TSQL based on some condition and based on that it is using 25 different function to populate the data into different 25 column. Tsql returning correct data and is working fine in Enterprise manager. But in my SSIS package it show me time out ERROR.

I have increase and decrease the time to catch the error but it is still there i have tried to set 0 for commandout Properties.

if i'm using the 0 for commandtime out then i'm getting the Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.

and

Failed to open a fastload rowset for "[dbo].[P@@#$%$%%%]". Check that the object exists in the database.

Please help me it's very urgent.

View 3 Replies View Related

Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction.

Feb 6, 2007

I am getting this error  :Distributed transaction completed. Either enlist this session in a new
transaction or the NULL 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.OleDb.OleDbException: Distributed transaction completed. Either
enlist this session in a new transaction or the NULL transaction.have anybody idea?!

View 1 Replies View Related

Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction.

Dec 22, 2006

i have a sequence container in my my sequence container i have a script task for drop the existing tables. This seq. container connected to another seq. container. all these are in for each loop container when i run the package it's work fine for 1st looop but it gives me error for second execution.

Message is like this:

Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.

View 8 Replies View Related

Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction. (HELP)

Jan 8, 2008

Hi,

i am getting this error "Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.".

my transations have been done using LINKED SERVER. when i manually call the store procedure from Server 1 it works but when i call it through Service broker it dosen't work and gives me this error.



Thanks in advance.


View 2 Replies View Related

Blocked/Blocking

Dec 7, 1999

Hello...

Is it normal in SQL Server 6.5 the user who only running the query blocking the other user who try to update/add the records?

note: The query is a complex SQL.

Many Thanks!

View 2 Replies View Related

Blocked Process

Mar 17, 1999

We are using SQL server 6.5 and currently have about 100 users connections at a given
point in time. The application is Visual Basic 5.0 based and it allows users to create
MS Word documents from the application. These documents names are stored in a table which basically
acts as a reference table. Every time a document needs to be attached to a record
this table is called with an insert/update query. This results in an exclusive page/table
lock and ends up into a blocked process. This finally results into a major halt for
all the system users.

Manual killing of these blocked processes frees up the resources and brings things back to normal
although disruptive to the users.

Any clue as to why the blocked processes are not able to free themsevles up ?
Are we missing something in our SQL configuration that will help us with unblocking
these processes ?

View 1 Replies View Related

Shrink Db Blocked

Feb 27, 2002

Hi,

Issuing 'dbcc shrinkfile (log ,truncateonly)'

I get the error message below. Books online doesn't say any more.
Can anyone explain? I am the only user connected to the db at the time, no jobs are executing.

Cannot shrink log file 2 (log) because all logical log files are in use.

(1 row(s) affected)

DBCC execution completed. If DBCC printed error messages, contact your system administrator.

View 1 Replies View Related

Blocked By SPID -1?????

Oct 6, 1998

What is SPID -1? I see nothing listing it in any activity monitor, but it has just recently started blocking some processes.


Thanks,
jim craddock

View 3 Replies View Related

Still Getting Blocked Despite WITH (NOLOCK)

Apr 5, 2006

I'm running a heavy SELECT query using WITH (NOLOCK). This still causes other processes trying to INSERT in one of the tables to get blocked.
I thought the locking hint would prevent from blocking other processes?

View 4 Replies View Related

Your Upgrade Is Blocked

Jun 29, 2006

I am getting the following error message when I tried installing the 2005 Developer Edition from the MSDN kit. I previously installed the 2005 Express Edition, and it worked just fine, so I thought that the install failed as it was at a lower version than the Express Edition. I uninstalled the SQLExpress Edition, however, when I try to install SQL Server 2005 again, I get the following message:



Name: Microsoft SQL Server 2005 Tools

Reason: Your upgrade is blocked. For more information about upgrade support, see the "Version and Edition Upgrades" and "Hardware and Software Requirements" topics in SQL Server 2005 Setup Help or SQL Server 2005 Books Online.

Build version check:

Your upgrade is blocked because the existing component is a later version than the version you are trying to upgrade to. To modify an existing SQL Server component, go to Add or Remove Programs in Control Panel, select the component you would like to modify, and then click Change/Remove.

Name: Microsoft SQL Server 2005 Tools

Reason: Your upgrade is blocked. For more information about upgrade support, see the "Version and Edition Upgrades" and "Hardware and Software Requirements" topics in SQL Server 2005 Setup Help or SQL Server 2005 Books Online.

Build version check:

Your upgrade is blocked because the existing component is a later version than the version you are trying to upgrade to. To modify an existing SQL Server component, go to Add or Remove Programs in Control Panel, select the component you would like to modify, and then click Change/Remove.



I have also installed Visual Studio NET, and I wonder if some component in the Studio app is holding back the SQL Server install. I have uninstalled all SQL components several times already, and I keep on getting this message.



Gregory



Gregory

View 1 Replies View Related

Mirroring Blocked And DB Got Down!!!

May 4, 2008

Hi all,


I have an SQL Server 2005 mirroring config with "High availability". Twice over the past four weeks, the principal server started logging to the event log:

"All schedulers on Node 0 appear deadlocked due to a large number of worker threads waiting on DBMIRROR_DBM_EVENT" I checked the database activity monitor and indeed there were lots of processes in DBMIRROR_DBM_EVENT.

The database was totally unresponsive to queries (all got timeouts), and no failover was done.

This are the log entries for all day:

05/04/2008 08:40:44,Server,Unknown,All schedulers on Node 0 appear deadlocked due to a large number of worker threads waiting on DBMIRROR_DBM_EVENT. Process Utilization 0%.
05/04/2008 08:39:44,Server,Unknown,All schedulers on Node 0 appear deadlocked due to a large number of worker threads waiting on DBMIRROR_DBM_EVENT. Process Utilization 0%.
05/04/2008 08:38:44,Server,Unknown,All schedulers on Node 0 appear deadlocked due to a large number of worker threads waiting on DBMIRROR_DBM_EVENT. Process Utilization 0%.
05/04/2008 08:37:44,Server,Unknown,All schedulers on Node 0 appear deadlocked due to a large number of worker threads waiting on DBMIRROR_DBM_EVENT. Process Utilization 0%.
05/04/2008 08:36:44,Server,Unknown,All schedulers on Node 0 appear deadlocked due to a large number of worker threads waiting on DBMIRROR_DBM_EVENT. Process Utilization 0%.
05/04/2008 08:35:44,Server,Unknown,All schedulers on Node 0 appear deadlocked due to a large number of worker threads waiting on DBMIRROR_DBM_EVENT. Process Utilization 0%.
05/04/2008 08:33:49,Server,Unknown,The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.
05/04/2008 03:24:02,Backup,Unknown,Log was backed up. Database: TeleCable<c/> creation date(time): 2007/08/24(13:38:00)<c/> first LSN: 205089:18926:1<c/> last LSN: 209688:18463:1<c/> number of dump devices: 1<c/> device information: (FILE=1<c/> TYPE=DISK: {'\face01f$logbackup'}). This is an informational message only. No user action is required.
05/04/2008 00:00:14,spid24s,Unknown,This instance of SQL Server has been using a process ID of 1700 since 4/9/2008 3:18:54 AM (local) 4/9/2008 1:18:54 AM (UTC). This is an informational message only; no user action is required.

After that, the same entry once per minute.

I restarted the database and everything came to normal.


As you can imagine, the problem is really serious.

Should I forget about mirroring? Anyone has experienced something similar?

Thanks in advance and best regards.

View 11 Replies View Related

Killing A Blocked Process

Jul 21, 1999

If I kill a blocked process, why does the current activity window still show the process? Both processes, blocking and blocked, are scheduled tasks. Also, the blocked process is still listed as a running task in the manage scheduled task window.

View 1 Replies View Related

Process Being Blocked By SPID -1

May 10, 1999

The following is an extract from sp_who2

SPID Status Login HostName BlkBy DBName Command CPUTime DiskIO
----- ---------- ------- -------- ----- ------- ------- ------- ------
162 sleeping om18682 . -1 STIPROD SELECT 236 120

Has anybody experienced a process being blocked by SPID -1.

View 4 Replies View Related

Connection Blocked By Process -2

Oct 18, 2007

Hi,

I have a fairly complex application running which has numerous connections on various threads accessing my sql 2005 database.

Every now and then I find that one of my connections is being blocked by process with a pid of -2.

I assume this is some system process.

The only way I can get my application going again is to restart the sql server.

Can someone tell me what process -2 is?

cheers,
Robert

View 2 Replies View Related

Insert Statement Blocked

Sep 25, 2006

HiShortly, I keep invoices in a table.Occasionally, someone will fire the execution of a stored procedure(SP) that performs several UPDATEs against (potentially) all invoicesOLDER than a date that is supplied to the SP as a parameter.The SP is usually a lengthy process (it takes at least 30 mins).The problem is that SQL server 2000 Dev Edition doesn't allow me toinsert new invoices that are "younger", while the SP is executing.How should I specify to SQL Server that new invoices are "harmless"?Thanks.

View 8 Replies View Related

How Long A Table Blocked

Jul 20, 2005

I have written a stored procedure to list out all tables in whichrows or the table itself is locked. The only information I amnot able to get is the time when the lock occurred. The way Iwant is that if I run the procedure it should show all lockson a table which are at least 5 or x seconds old. This way I canavoid momentary locks on a table which go away after few seconds.Which table and column of master database has that information?Thanks.--email id is bogus

View 3 Replies View Related

Database Blocked - URGENT!!

Apr 2, 2007

Hi guys,



we have a database here and something happened which causes a database block. We tried to run the 'sp_who' 'active' command to see the spid which locked the database, and we found out that some transaction is blocking another transaction. The following is the sample data results from the sp_who 'active'





spid ecid status loginame hostname blk dbname cmd

52 0 sleeping HOSTINGSQLMonitor BLUE2 185 tempdb INSERT
53 0 sleeping sa 10.10.10.106 185 mfgq_live SELECT
56 0 sleeping sa 10.10.10.106 175 mfgq_live UPDATE
57 0 sleeping sa 10.10.10.143 185 mfgq_live SELECT




We killed all spid which casuse the blocking, but they are keep on coming.



Does anybody have any idea on what casuses this problem or a teporary solution for this? Please help.



Thx

View 1 Replies View Related

Spid Blocked By Itself On SQL 2000 SP4

Jul 31, 2007

Hi

On one of my SQL servers (SQL 2000 SP4) i have a problem with spid blocked by itself (spid 54 (Blocked by 54)).

On the server it's running a verry simple UPDATE statement (from the Query Analizer)'. The query needs very long time to finalize (on SP3 it was very fast). I searched some forums regarding this issue and i found that maybe the SP4 can cause this problem.

Do you have any idea or advice?

Thanks


View 17 Replies View Related

SQL 2005 SP2 Installation Blocked

Feb 20, 2007

I'm getting the following error when I try to run SQL05 SP2 on my server. When I get to the Authentication screen, I select Windows Authentication and check the box to use for all services. I am logged in using my personal admin account. I click the 'Test' button. Connection to Database Services, instance name 'MSSQLSERVER' is successful. However, connection to Reporting Services, instance name 'myserverSSRS' fails. The error message is: "Login failed: HResult 0x2, Level 16, State 1, Named pipes provider: Could not open a connection to SQL Server[2]. Sqlcmd: Error: Microsoft SQL Native Client: An error has occurred while establishing a connection to the server. When connecting to SQL Server."

I've had problems getting Reporting Services to work. Is this message a result of SSRS not being set up properly? How can I correct this?

View 7 Replies View Related

SQL In SSIS Package Sometimes Is Blocked.

Apr 17, 2007

I have an SSIS package that is basic in nature. It imports a flat file and makes some inserts to tables via OLE destination and also updates some tables via stored procedure calls using params. Sometimes the process "locks" and never finishes. When it locks it gets locked by process "-2" or a value that is not an actual process. What does this mean? What is -2?

View 3 Replies View Related

VB Database Connection Blocked

Jun 8, 2007

Message: Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled' to generate user instances.



I am using VB2005 Express. I had, evidently, a simpler version of SQL but deleted it, as was recommended, and then downloaded SQL 2005 Express. Now when trying to open an SQL database in a project I get that Information Message.



FURTHERMORE after loading the new SQL it wiped out all of my projects in VB 2005. The back up files were wiped out also.

That was naughty!

Thank you in advance for a reply.

gascitydan@yahoo.com

View 3 Replies View Related

Deadlock - Killing Blocked Process

Nov 24, 1999

we have tables that load overnight. Sometimes a user will try to run a query up against that table while the table is loading and a deadlock occurs. I do not notice this until I get into the office. By this time many tables have not loaded. Is there a way to have SQL6.5 automatically Kill deadlock processes.

View 1 Replies View Related

Blocked 'sleeping' Active Connections

Sep 27, 2005

Hi

We just installed SQL service pack 4. I am now finding that when doing a sp_who2 active, there are a lot of connections that are blocked by itself. The common factor is they all have a status of 'sleeping'. The strange thing is that even though it shows the connection is blocked, it is in fact not and will still return results. Below is a snapshot of a portion of what the sp_who2 active returns:

SPID Status Login HostName BlkBy DBName
53 sleeping sa TRACKER 53 dbABC
58 sleeping sa TRACKER 58 dbCDE
64 sleeping sa TRACKER 64 dbSTA
66 RUNNABLE User12 PC24 . master
70 sleeping User5 ANALYSIS 70 dbBML
74 sleeping sa TRACKER 74 dbCDE
76 sleeping sa TRACKER 76 dbPTS
83 sleeping User5 ANALYSIS 83 dbANA
86 DORMANT User11 CPTDB . NULL

Has anyone seen this? Is it related to the installation of service pack 4? (We have installed the services pack on many other SQL servers, but have not come accross this before.

Tx,
TessZA

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved