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     [CASE-OPENED] Maintain crashes the agent at For all Update

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CASE-OPENED] Maintain crashes the agent at For all Update
 Login/Join
 
Virtuoso
posted
This is the first time I'm working with maintain and I'm stuck at my attempts on updating modified records from a grid control. I don't get an error when executing my GridUpdate function, but the agent crashes! I'm probably doing something wrong, but what?

The crash happens in the event function for my Save button:
Case GridUpdate
	Infer speedip.SPEEDIP.SISPED into UpdateSpeedIpStk;
	Stack Copy From GetSpeedIpStk Into UpdateSpeedIpStk Where EDIT_IND EQ 1;

	$$ Ignore the rest if there were no changes
	If UpdateSpeedIpStk.FocCount EQ 0 Then Goto EndCase;

$$ DEBUG
$$	Stack clear GetSpeedIpStk ;
$$	Stack Copy From UpdateSpeedIpStk Into GetSpeedIpStk;
$$	Winform Show DebugForm;
$$Goto EndCase;

	For all Update SICGERM SIULUP SIDLUP from UpdateSpeedIpStk;

$$Goto EndCase;
	If FocError EQ 0 Then Begin
		COMMIT;
	EndBegin
	Else Begin
		Type "An error occurred attempting to save the changes: <FocError";
		ROLLBACK;
	EndBegin
EndCase


If I uncomment the bit at the DEBUG comment, I do get the correct data in a HTML form. The only thing incorrect there is that the EDIT_IND field is set to 0 instead of 1, but I'm pretty sure that's because the UpdateSpeedIpStk stack doesn't contain that field (the DebugForm uses the GetSpeedIpStk to iterate over the data and that stack does contain that field).

If I instead uncomment the Goto right after the UPDATE statement, the agent crashes - same as when I leave that line commented. So apparently the error isn't in the final checks either.

I do know that the system user performing the UPDATE (the user under which the WF server is running, I presume?) is not authorized to perform updates on that table. Could that be what's causing these agent crashes?

One other possible point of failure, my OnEditFinish event handler contains:
Case OnGrid1_OnEditFinish Takes col / I12, row / I10B, text / A0, cancelFlag / I1;
	Declare r/I4 = ListForm.Grid1.ClickRow;
	Declare Today2/A10 = TODAY2();
	Declare Today/DateCnvrt;
	Declare LUDate/P9;

	If GetSpeedIpStk(r).SICGERM EQ text Then Goto EndCase;

$$	Type "Updating row: <r";

	Compute Today.setTxtDate('12/09/2013');
	Compute LUDate = Today.getIntDate();

$$	Type "Today: <LUDate";

	Compute GetSpeedIpStk(r).SICGERM = text;
	Compute GetSpeedIpStk(r).EDIT_IND = 1;
	Compute GetSpeedIpStk(r).SIULUP = 'IADMIN';
	Compute GetSpeedIpStk(r).SIDLUP = LUDate;
EndCase


I am a bit surprised that I couldn't use the row parameter directly, but it was one-off and updated the row above the one clicked (what's the point?). I also get the impression that there might be some way to assign those field values in a more efficient way than to reference row r of the stack over and over again?

These are bonus questions though, the real issue is of course the agent crash! Wink

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
Nothing looks wrong straight off.

The only thing I can see that may cause an issue is the Today class. There already exists a today function. Could they interfere with each other?

Also are you sure you want to have:
Compute Today.setTxtDate('12/09/2013');

I would expect a return for a Compute.

The update user for the SQL data is the user on the agent, depends on your security.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
The class is actually called DateCnvrt, it's only a variable that's named Today.
It's also not the culprit here, as the code doesn't work without it either. The agent still crashes if I comment out all the date related stuff.

Perhaps Maintain has issues writing to DB/400?
Is there any way to see what queries it sends to the DB?

I suppose it's time to open a case then.

P.S. Yeah, that hard-coded date I encountered right after I posted here; it's a left-over of getting my DateCnvrt class working. it reads as thus now:
	Compute Today.setTxtDate(Today2);


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
It's the agent crashing that puzzles me. I have had all sorts of errors writing data, but never an agent crash for that reason.

Had many agent crashes, but generally was stupid code. And your code doesn't fall into that category.

Can you write a simple Maintain to just run an Update onto the table and see what happens?

Set the trace on and see what happens. Trace instructions here.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
I just realised that the WF server we run this on is not directly connected to the database. Instead, it is connected to another WF server running on our IBM iSeries. That server also houses the database.

Do we need to call Update on the remote server? And how do we do that?

In FOCUS, we use code like below to do that.
-REMOTE BEGIN
...
-REMOTE END


How is that done in Maintain?


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
One for Mark I reckon. Don't know any way of achieving that.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
The code looks simple enough. It may be a problem writing to the database. I see you have opened a case and uploaded the Maintain file. Can you please upload the Master / Access file so we can test?

Thank you.
Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report 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     [CASE-OPENED] Maintain crashes the agent at For all Update

Copyright © 1996-2020 Information Builders