-
1. Re: Teiid 9.0.0 - afterLoadScript giving exception in loadMatView
shawkins Jul 1, 2016 10:53 AM (in response to mtawk)Can you produce a debug or trace log around the time of the failure? It's expected that the warn log should be there, but we should at least see what is happening around that time that may indicate what is happening.
-
2. Re: Teiid 9.0.0 - afterLoadScript giving exception in loadMatView
mtawk Jul 1, 2016 10:57 AM (in response to shawkins)I tried to add to the exception part: RAISE SQLEXCEPTION e.exception;
But i'm getting an error in the procedure incompatible types object and string.
Can you please tell me the synthax to write to get the exception message through RAISE SQLEXCEPTION?
-
3. Re: Teiid 9.0.0 - afterLoadScript giving exception in loadMatView
shawkins Jul 1, 2016 12:24 PM (in response to mtawk)e.exception is of exception/object type, but RAISE SQLEXCEPTION expects a string for the message argument. You want to do something like:
raise sqlexception 'something failed' chain e.exception;
-
4. Re: Teiid 9.0.0 - afterLoadScript giving exception in loadMatView
mtawk Jul 1, 2016 4:40 PM (in response to shawkins)I wanted to know the exception message to know what is wrong in afterLoadScript, the same script worked fine in version 8.11.3.
I saw there were changes in afterLoadScript in version 9.0.0, in version 8.11.3 the script was split by semi-column and executed each part. In 9.0.0 it is executed one shot.
in which logger logMsg writes when having an exception in loadMatView ?
-
5. Re: Teiid 9.0.0 - afterLoadScript giving exception in loadMatView
shawkins Jul 1, 2016 4:50 PM (in response to mtawk)> I saw there were changes in afterLoadScript in version 9.0.0, in version 8.11.3 the script was split by semi-column and executed each part. In 9.0.0 it is executed one shot.
That is [TEIID-4240] Anonymous procedure blocks should be used for materialization scripts - JBoss Issue Tracker - which simplifies the incorrect delimiting logic that was used in several places.
Even if the old style metadata is used, during load the logic will wrap that in a procedure block. Is it possible that you are still using cached metadata?
> in which logger logMsg writes when having an exception in loadMatView ?
The server log using the org.teiid.MATVIEWS context at the warn level, or do you mean something else?
-
6. Re: Teiid 9.0.0 - afterLoadScript giving exception in loadMatView
mtawk Jul 4, 2016 6:05 AM (in response to shawkins)The problem was coming from this part of afterLoadScript : SELECT ON_VIEW_LOADED_COMPLETE(''VIEW.B7F553FA-4F52-45FE-82BD-E2C18A4658B2.User'')
It is a virtual function created on our vdb that executes when materialization finishes but i don't know why it is not reachable in afterLoadScript
I have put the virtual function into ON_VDB_DROP_SCRIPT, and it is called successfully but 2 times at each materialization.
-
7. Re: Teiid 9.0.0 - afterLoadScript giving exception in loadMatView
shawkins Jul 6, 2016 9:27 AM (in response to mtawk)> The problem was coming from this part of afterLoadScript : SELECT ON_VIEW_LOADED_COMPLETE(''VIEW.B7F553FA-4F52-45FE-82BD-E2C18A4658B2.User'')
What specifically is the problem?
> I have put the virtual function into ON_VDB_DROP_SCRIPT, and it is called successfully but 2 times at each materialization.
Do you mean that you are seeing multiple invocations, but only expect 1?
-
8. Re: Teiid 9.0.0 - afterLoadScript giving exception in loadMatView
mtawk Jul 7, 2016 9:02 AM (in response to shawkins)The function ON_VIEW_LOADED_COMPLETE gives an exception when called into afterLoadScript while if put into ON_VDB_DROP_SCRIPT it is well called.
I was not able to get the exception message into loadMatView procedure, I looked into TeiidMatViews.log and no exception is written in there.
-
9. Re: Teiid 9.0.0 - afterLoadScript giving exception in loadMatView
shawkins Jul 13, 2016 4:24 PM (in response to mtawk)Can you provide the full after load script that is failing?
-
10. Re: Teiid 9.0.0 - afterLoadScript giving exception in loadMatView
mtawk Jul 14, 2016 3:49 AM (in response to shawkins)"teiid_rel:MATVIEW_AFTER_LOAD_SCRIPT" 'execute implify_dataModel.native(''ALTER TABLE "implify_data"."User" RENAME TO "implify_data"."User_temp"'');execute implify_dataModel.native(''ALTER TABLE "implify_data"."User_stage" RENAME TO "implify_data"."User"'');execute implify_dataModel.native(''ALTER TABLE "implify_data"."User_temp" RENAME TO "implify_data"."User_stage"'');execute implify_dataModel.native(''truncate table "implify_data"."User_stage"''); SELECT ON_VIEW_LOADED_COMPLETE(''VIEW.B7F553FA-4F52-45FE-82BD-E2C18A4658B2.User'') '
the call of the following function is causing the exception, but i did not find the log file where the exception is written
SELECT ON_VIEW_LOADED_COMPLETE(''VIEW.B7F553FA-4F52-45FE-82BD-E2C18A4658B2.User'')
if I put the function into ON_VDB_DROP_SCRIPT, it is called successfully
-
11. Re: Teiid 9.0.0 - afterLoadScript giving exception in loadMatView
shawkins Jul 14, 2016 1:01 PM (in response to mtawk)Thanks Mark. This does look like an issue with TEIID-4240 such that the resolving is expecting all of the statements to return the same result set or use the no return option - but that should not be required to be consistent with the old behavior. Can you log an issue for that? And I'll also address why there isn't a log happening.
-
12. Re: Teiid 9.0.0 - afterLoadScript giving exception in loadMatView
mtawk Jul 15, 2016 4:26 AM (in response to shawkins)New issue added : TEIID-4342
-
13. Re: Teiid 9.0.0 - afterLoadScript giving exception in loadMatView
shawkins Jul 15, 2016 8:56 AM (in response to mtawk)This will be addressed for 9.0.2 which will be available today or Monday.