Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Running Stored Procedure From WebFOCUS Locks Out Others From SQL Server DB

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Running Stored Procedure From WebFOCUS Locks Out Others From SQL Server DB
 Login/Join
 
Member
posted
Whenever I run a SQL Server 2000 stored procedure within WebFOCUS nobody else can connect to the SQL Server database or run any other stored procedures until it completes. This includes people running Access Projects and Access databases with linked tables, as well as trying to run stored procedures within SQL Server using SQL Query Analyzer. I can run the same stored procedure from within SQL Server using SQL Query Analyzer and the database is available to anyone. This behavior occurs no matter what the stored procedure is.

I opened a case for this several weeks ago. The IBI folks suggested I throw it out to the Focal Point community to see if anyone has (or had) this problem.

Below are two methods of creating the SQL Server table using WebFOCUS I have tried. The first executes the stored procedure. The second passes the SQL code that replicates the stored procedure executed in method one. They both cause the database access lockout problem.

----------------------------------------------------------------------------------

 -* File CreateNAT2_SP_Only.fex
-TYPE CreateNAT2_SP_Only
-RUN
-******************************************************************************
SQL SQLMSS
   EXEC GPUD2008_Reporting.dbo.usp_CreateHoldNAT
END
-******************************************************************************
 


------------------------------------------------------------------------------

-* File NAT2_Database_Locking.fex
-TYPE NAT2_Database_Locking
-******************************************************************************
SQL SQLMSS
-*   EXEC GPUD2008_Reporting.dbo.usp_CreateHoldNAT
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HoldNAT]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
truncate table [dbo].[HoldNAT];
--
else
--Create and index HOLDNAT if it does not exist
  begin
    CREATE TABLE HoldNAT
     (
      trk_Year VARCHAR (4) NOT NULL ,
      char_Project VARCHAR (10) NOT NULL ,
      trk_System VARCHAR (4) NOT NULL ,
      trk_TagCode VARCHAR (7) NOT NULL ,
      trk_Source VARCHAR (13) NOT NULL ,
      trk_PeakLocation INTEGER  NOT NULL ,
      trk_DetectDateTime DATETIME NOT NULL ,
      hyd_HydrophoneNumber INTEGER  NOT NULL ,
      hyd_HydrophoneOrder INTEGER  NULL ,
      hyd_Route VARCHAR (10) NULL ,
      hyd_Route_Order INTEGER  NULL ,
      char_Species VARCHAR (2) NOT NULL
     )

   ALTER TABLE [dbo].[HoldNAT] WITH NOCHECK ADD
     CONSTRAINT [PK_HoldNAT] PRIMARY KEY  CLUSTERED
     (
      [trk_Year],
      [char_Project],
      [trk_System],
      [trk_TagCode],
      [trk_Source],
      [trk_PeakLocation],
      [trk_DetectDateTime],
      [hyd_HydrophoneNumber]
     )  ON [PRIMARY]
  end;
END
SQL SQLMSS
INSERT HoldNAT
( trk_Year,
  char_Project,
  trk_System,
  trk_TagCode,
  trk_Source,
  trk_PeakLocation,
  trk_DetectDateTime,
  hyd_HydrophoneNumber,
  hyd_Route,
  hyd_Route_Order,
  hyd_HydrophoneOrder,
  char_Species
)

SELECT
 T2.trk_Year,
 T1.char_Project,
 T2.trk_System,
 T2.trk_TagCode,
 T2.trk_Source,
 T2.trk_PeakLocation,
 T2.trk_DetectDateTime,
 T3.hyd_HydrophoneNumber,
 T3.hyd_Route,
 T3.hyd_Route_Order,
 T3.hyd_HydrophoneOrder,
 T1.char_Species

FROM
 ( ( GPUD2008_Reporting.dbo.Rep_Characteristics T1 INNER JOIN
 GPUD2008_Reporting.dbo.Rep_Tracking T2 ON T2.trk_Year = T1.char_Year
 AND T2.trk_TagCode = T1.char_TagCode ) LEFT OUTER JOIN
 GPUD2008_Reporting.dbo.Rep_Hydrophones T3 ON T3.hyd_Year = T2.trk_Year
 AND T3.hyd_System = T2.trk_System AND
 T3.hyd_HydrophoneNumber = T2.trk_Hydrophone )

WHERE
 (T1.char_Year = '2008') AND (T1.char_Project IN('CPUD',
'GPUD')) AND (T2.trk_System <> 'TGLF') AND (T2.trk_System <> 'PREP')

ORDER BY
trk_Year, char_Project, trk_System, trk_TagCode, trk_Source, trk_PeakLocation, trk_DetectDateTime, hyd_HydrophoneNumber;
END
-******************************************************************************
-RUN


-------------------------------------------------------------------------------

This message has been edited. Last edited by: Kerry,
 
Posts: 22 | Location: Seattle, WA | Registered: March 29, 2007Report This Post
Master
posted Hide Post
Michael

During the execution of the proc you will effectively have an exclusive lock on HoldNAT regardless of whether it is wf or query analyser executing.

If HoldNAT is required by other users they will be locked out. What is the error condition returned by your users?



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006Report This Post
Expert
posted Hide Post
This may help in making the SP more efficient:

Eliminate the Use of Temporary Tables For HUGE Performance Gains


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
I think I have it (I forgot SS2000 locks on reading unlike Oracle)

The default isolation level in wf is

(FOC1758) CURRENT ISOLATION LEVEL IS - : RC

You probably need to downgrade this to Read Uncommitted or more importantly whatever your query analyser tool uses.

http://www.mssqlcity.com/Articles/General/TIL.htm



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006Report This Post
Member
posted Hide Post
I will try changing the isolation level to 'Read Uncommitted'. I will also try Francis' suggestions on speeding up the stored procedure.

The interesting thing about this problem is that users cannot access any tables (not just HoldNAT) in the database while WebFOCUS runs a stored procedure.

Thanks for the help. I will get back with the results soon.
 
Posts: 22 | Location: Seattle, WA | Registered: March 29, 2007Report This Post
Member
posted Hide Post
Changing the transaction isolation level to 'Read Uncommitted' did not help. The entire database was not available to other users while the HoldNAT table was created.

I am working on speeding up the stored procedure using tips from the article that Francis suggested.

This is all very odd. I wonder if it is a security issue with the way WebFOCUS connects to SQL Server?
 
Posts: 22 | Location: Seattle, WA | Registered: March 29, 2007Report This Post
Expert
posted Hide Post
Take a look at this documentation:

"Adapter Administration for UNIX, Windows, OpenVMS, i5/OS, and z/OS" > "Using the Adapter for Microsoft SQL Server" > "Customizing the Microsoft SQL Server Environment"

There may be a setting you can add to your update program - there's a lot of stuff to read.

Good luck,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
Thank you. I will dig into it!
 
Posts: 22 | Location: Seattle, WA | Registered: March 29, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Running Stored Procedure From WebFOCUS Locks Out Others From SQL Server DB

Copyright © 1996-2020 Information Builders