dbo.QBM_PJobQueueInit
SQL_STORED_PROCEDURE
Created 2025-06-27T18:01:00.243 · modified 2026-04-14T23:20:31.763 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@queue | nvarchar | no |
@SessionID | varchar | no |
@MaxWaitTimeForLock_s | int | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| JobQueue | OBJECT_OR_COLUMN | ||
| QBM_PJobQueueInit_i | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_PWaitForSeconds | OBJECT_OR_COLUMN | ||
| dbo | QBM_FGISessionErrorRethrow | OBJECT_OR_COLUMN |
Source excerpt
First extracted SQL definition lines from the exported source. Use the full source page for complete context.
1 create procedure QBM_PJobQueueInit (@queue nvarchar(255) , @SessionID varchar(38) = '' , @MaxWaitTimeForLock_s int = 40 ) as begin declare 2 @TestBetrieb bit = 0 declare @RCAppLockRequest int = 0 declare @MyName nvarchar(64) = object_name(@@procid) declare @WartenEinVersuch_ms int = 1000 declare 3 @WartenBisWiederholung_s int = 1 declare @Gestartet datetime = getutcdate() declare @HabeInitialisiert int = 1 SET XACT_ABORT OFF begin transaction BEGIN 4 TRY WirVersuchen: if datediff(ss, @Gestartet, getutcdate()) > @MaxWaitTimeForLock_s begin select @HabeInitialisiert = -1 exec QBM_PJobQueueInit_i @Queue 5, @SessionID, @SetSessionOnly = 1 goto endlabel end if not exists (select top 1 1 from JobQueue q with (readpast) where q.Ready2EXE in (N'LOADED', N'PROCESSING' 6, N'MISSING', 'FINISHED') and q.Queue = @queue ) and @TestBetrieb = 0 begin exec QBM_PJobQueueInit_i @Queue, @SessionID, @SetSessionOnly = 1 goto endLabel 7 end exec @RCAppLockRequest = sys.sp_getapplock @Resource = @MyName , @LockMode='Exclusive' , @LockOwner='Transaction' , @LockTimeout = @WartenEinVersuch_ms 8 if @RCAppLockRequest < 0 begin exec QBM_PWaitForSeconds @WartenBisWiederholung_s goto wirVersuchen end exec QBM_PJobQueueInit_i @Queue, @SessionID 9, @SetSessionOnly = 0 END TRY BEGIN CATCH select @HabeInitialisiert = -1 exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow 10() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH EndeMitRelease: exec sp_releaseapplock @Resource = @MyName , @LockOwner = 'Transaction' EndLabel: 11 if @@TRANCOUNT > 0 begin commit transaction end return (@HabeInitialisiert) end 12
Module relation graph
Loading module relation graph…
Source-derived context
Generated from exported SQL module definitions plus read-only sandbox sys.objects/sys.parameters/sys.sql_expression_dependencies metadata. This is factual source evidence, not a semantic guess.
provenance: SQL definition export provenance: sandbox DB metadata modified: 2026-04-14T23:20:31.763
has TRY/CATCH error handling
Summary: calls QBM_PJobQueueInit_i, sys, QBM_PWaitForSeconds, QBM_PSessionErrorAdd, sp_releaseapplock; reads/joins JobQueue
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@queue | nvarchar(255) | input |
@SessionID | varchar(38) | input |
@MaxWaitTimeForLock_s | int | input |
DML targets
None extracted.Read/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: None extracted.
Variables: @queue @SessionID @MaxWaitTimeForLock_s @TestBetrieb @RCAppLockRequest @MyName @procid @WartenEinVersuch_ms @WartenBisWiederholung_s @Gestartet @HabeInitialisiert @Queue @SetSessionOnly @Resource @LockMode @LockOwner @LockTimeout @Rethrow @TRANCOUNT
Referenced by / reverse dependencies
Generated from live DB metadata, FK rows, and exported SQL dependency/source extraction. This is factual linkage evidence, not inferred behavior.
No reverse dependencies extracted.