Flyway (and Liquibase) allows migrations to be written in SQL so you don't need a fully integration to be able to use them with Cache/IRIS. Fully integrating (e.g. extending Flyway) would provide access to other automations and features that otherwise are not available with just SQL e.g. using the same script in different DBMS. In the case of Liquibase, automated rollback generation, etc.
The list of steps depend on how is your current application built (e.g. are you using direct global access vs. SQL). Depending on which direction you want to go you could simply wrap your existing objectscript code in either stored procs or services and access them from Java or rewrite all your existing logic in Java.
Again, the steps would depend on what exactly you're trying to accomplish and your current app makings.
Your index is a bitmap index, have you tried changing it to a regular index just for testing if the behavior changes? There are restrictions on when to use a bitmap index. Wondering if the engine is considering the bitmap to be slower than full table scan in this situation.
It depends what you're trying to do. Lists are exposed through SQL as comma delimited strings (default). You can change how lists are projected to mimic how arrays are projected which is as a "child" table (default). Keep in mind, this all depends on how Settings is defined/stored. e.g. if it's a separate table with its own ID, then the settings list on the config.item table will only contain the IDs and that's all your getting.
What are you referring as invalid column name in this scenario?
Why are you checking with invalid columns in the first place? If you know you can have invalid columns then you'd need to add proper error handling for it. You either check the metadata first for valid columns or add exception handling for it.
As for why %SQL.Statement* classes are preferred is due to the improvements these classes contains in terms of usability and performance when compared with the "legacy" %Library.ResultSet.
How are you running both scenarios? The error you're getting is mostly a symtom of the Cache JDBC jar not being present in the classpath. When you run locally it may be present in your IDE but it's not being included in your build thus the REST code is failing.
While this is certainly possible, you'd be breaking the "contract". %OnNew() is expected to return a %Status that will be handled by %New(). This means the exception will be thrown by %OnNew() but %New() won't care about it and still return an object (unless something else prevents it from doing so).
The error should be in the %objlasterror variable. You would have to check: if %New() returned a new instance, if not then check the value of %objlasterror. Then perform any error handling you'd like to do.
try/catch doesn't work because %New() doesn't throw any exceptions.
It's hard to tell what's wrong without all (or more) details. Are you getting an error? If you're not getting an error, are you passing the correct values (values that should return records)? Also, have you tried creating a very basic stored proc in Oracle (select current_date from dual or something like that) and try to use that from IRIS? The exercise will help you eliminate variables for possible issues.
You can map an Oracle Stored procedure to IRIS method using the SQL Gateway. Once the mapping is done, you can expose it with a service or any other means IRIS provides.
Do you have any tips to make csp changes flow in realtime the same as classes do? I've modified the dockerfile to copy the contents of my csp directory into the container, however my edits to CSPs are not flowing realtime which forces me to rebuild the container everytime to get my updates.
First, thanks for this. It go me up and running pretty fast (as title says!). Couple of things:
- The notes/documentation say that code will be loaded into USER namespace, however it's actually being loaded into IRISAPP (as configured in docckerfiles).
- The jason.config is pointing to USER namespace so any new files and changes to existing will be actually loaded into USER instead of IRISAPP
- Make sure it's all consistent
- The webapp (irisweb) is missing a config for the directory where to store files. I fixed this by modifying the app in management portal. Need to address the installation file/dockerfile
- Haven't been able to make CSPs flow to the container the same as classes. I'm sure I'm missing something but haven't figured out what yet. Any tips? Maybe I'm placing files in the wrong location? Right now I created a csp/irisweb folder under src folder.
To add a new header, you need to create a subclass of %SOAP.Header with the property you need. Once you have that then you can add it to the appropriate array e.g.
S myheader = ##class(MyNewHeader).%New()
S myheader.mykeyproperty = <myvalue>
D myservice.HeadersOut.SetAt(myheader,"MyNewHeader")
This is assuming the header is not automatically generated from the XML schema.
go to post
Flyway (and Liquibase) allows migrations to be written in SQL so you don't need a fully integration to be able to use them with Cache/IRIS. Fully integrating (e.g. extending Flyway) would provide access to other automations and features that otherwise are not available with just SQL e.g. using the same script in different DBMS. In the case of Liquibase, automated rollback generation, etc.
go to post
You should be able to use the $SYSTEM.SQL.DATEADD("hh",1,$H)
It returns a timestamp you'd need to convert back to $H format if that's what you need.
go to post
Can you show the query plan? Usually this issue "shows" when indices are out of sync. Maybe try rebuilding indices.
go to post
The list of steps depend on how is your current application built (e.g. are you using direct global access vs. SQL). Depending on which direction you want to go you could simply wrap your existing objectscript code in either stored procs or services and access them from Java or rewrite all your existing logic in Java.
Again, the steps would depend on what exactly you're trying to accomplish and your current app makings.
go to post
The "||" is used to concatenate. So that's why it makes sense those are the ones used in the SQL you pasted instead of "!!".
go to post
Never seen that before. Are you sure those are ! and not ||? the latter makes sense as it's the concatenate operator.
go to post
CREATE GLOBAL TEMPORARY TABLE <mytable> {} has similar effects as process-private globals...
go to post
Your index is a bitmap index, have you tried changing it to a regular index just for testing if the behavior changes? There are restrictions on when to use a bitmap index. Wondering if the engine is considering the bitmap to be slower than full table scan in this situation.
go to post
It depends what you're trying to do. Lists are exposed through SQL as comma delimited strings (default). You can change how lists are projected to mimic how arrays are projected which is as a "child" table (default). Keep in mind, this all depends on how Settings is defined/stored. e.g. if it's a separate table with its own ID, then the settings list on the config.item table will only contain the IDs and that's all your getting.
go to post
What are you referring as invalid column name in this scenario?
Why are you checking with invalid columns in the first place? If you know you can have invalid columns then you'd need to add proper error handling for it. You either check the metadata first for valid columns or add exception handling for it.
As for why %SQL.Statement* classes are preferred is due to the improvements these classes contains in terms of usability and performance when compared with the "legacy" %Library.ResultSet.
go to post
How are you running both scenarios? The error you're getting is mostly a symtom of the Cache JDBC jar not being present in the classpath. When you run locally it may be present in your IDE but it's not being included in your build thus the REST code is failing.
go to post
While this is certainly possible, you'd be breaking the "contract". %OnNew() is expected to return a %Status that will be handled by %New(). This means the exception will be thrown by %OnNew() but %New() won't care about it and still return an object (unless something else prevents it from doing so).
go to post
The error should be in the %objlasterror variable. You would have to check: if %New() returned a new instance, if not then check the value of %objlasterror. Then perform any error handling you'd like to do.
try/catch doesn't work because %New() doesn't throw any exceptions.
go to post
It's hard to tell what's wrong without all (or more) details. Are you getting an error? If you're not getting an error, are you passing the correct values (values that should return records)? Also, have you tried creating a very basic stored proc in Oracle (select current_date from dual or something like that) and try to use that from IRIS? The exercise will help you eliminate variables for possible issues.
go to post
You can map an Oracle Stored procedure to IRIS method using the SQL Gateway. Once the mapping is done, you can expose it with a service or any other means IRIS provides.
go to post
Got it all working. Thank you!
go to post
Thank you. I'll check on it.
Do you have any tips to make csp changes flow in realtime the same as classes do? I've modified the dockerfile to copy the contents of my csp directory into the container, however my edits to CSPs are not flowing realtime which forces me to rebuild the container everytime to get my updates.
go to post
OK, I'll give it a try and create a PR once I have a new config file. Thanks!
go to post
First, thanks for this. It go me up and running pretty fast (as title says!). Couple of things:
- The notes/documentation say that code will be loaded into USER namespace, however it's actually being loaded into IRISAPP (as configured in docckerfiles).
- The jason.config is pointing to USER namespace so any new files and changes to existing will be actually loaded into USER instead of IRISAPP
- Make sure it's all consistent
- The webapp (irisweb) is missing a config for the directory where to store files. I fixed this by modifying the app in management portal. Need to address the installation file/dockerfile
- Haven't been able to make CSPs flow to the container the same as classes. I'm sure I'm missing something but haven't figured out what yet. Any tips? Maybe I'm placing files in the wrong location? Right now I created a csp/irisweb folder under src folder.
go to post
To add a new header, you need to create a subclass of %SOAP.Header with the property you need. Once you have that then you can add it to the appropriate array e.g.
S myheader = ##class(MyNewHeader).%New()
S myheader.mykeyproperty = <myvalue>
D myservice.HeadersOut.SetAt(myheader,"MyNewHeader")
This is assuming the header is not automatically generated from the XML schema.