Adaptor now aviable on zpm :
- Log in to post comments
Adaptor now aviable on zpm :
What a great promo.
Love It :)
Hi, here is a similar article about ensdemo for IRIS and IRIS for health.
https://community.intersystems.com/post/install-ensdemo-iris
Hi Lucas,
All security settings are store in the %SYS databases.
You can access then with this query :
select * from Security.System
Or with this procedure
select * from Security.System_List()
If you want to do this in COS :
s ResultSet=##class(%ResultSet).%New("Security.System:List")
d ResultSet.Execute()
While ResultSet.Next() {
zw ResultSet.Data("Name")
}Like that you don't have to use the export function who only create files.
Now you can parse data and build your report directly from an homemade object.
Hi Blaise,
You can pass %OnNew expection to %New with this code snippet :
Now when you call the new method :
USER>set test = ##class(Test.PersitenceTest).%New()
If $isobject($get(newerror))=1 Throw newerror
^
<THROW>%Construct+9^Test.PersitenceTest.1 *%Exception.StatusException ERROR #5659: Property 'Test.PersitenceTest::mandatory(10@Test.PersitenceTest,ID=)' required
Now you can catch you %OnNew expection anywhere :
Hi Kevin,
You can use IOAddr property from EnsLib.TCP.CountedInboundAdapter
IOAddr property come in this format : 57777<-127.0.0.1:54844
To extract the source IP adresse you can parse it like that :
Studio :
Atelier :
VS Code with Dmitriy's plugin
Serenji :
I haven't tried it yet because you need to install some classes on the server side, but sound very promising for debugging.
Conclusion :
My main IDE is VSCode with Dmitriys's plugin and some times Studio for find in files, csp managment and debugging.
Do you expect to be writing code in a web-based editor five years from now?
Yes, why not, already a lot of people do it on Jupyter Notebook.
The dialect of Intersystems IRIS being approved in the hibernate git repository.
The depot managers want to stop the "support" of the Cache dialect to position the IRIS one.
Hi Julian,
On what version of InterSystems product you are working on ?
If it's on Ensemble, check out ENSDEMO namespaces, you will have an example of what you are looking for with this production : Demo.DICOM.Production.StorageLocal
If you are on Iris for health you can install EnsDemo with the help of this git : https://github.com/grongierisc/InstallEnsDemoHealth
Thanks for sharing this knowledge on ObjectScript language.
I haven't heard of SOLID Principle before, I'll apply it on my next code.
BTW : can you share your sildes for an easier walkthrough ?
Thanks Marc,
Your code work great.
We gain a factor ten with this implementation.
Below our current implementation.
/// Structure of pParms is Caché Multidimensional Array /// Where : /// pParms indicate the number of row in batch /// pParms(integer) indicate the number of parameters in the row /// pParms(integer,integerParam) indicate the value of the parameter whose position is integerParam. Method ExecuteUpdateBatchParmArray(Output pNumRowsAffected As %Integer, pUpdateStatement As %String, pParms...) As %Status { set tStatus = $$$OK try{ set pSQLStatement=pUpdateStatement // JDBCGwy is an instance of the JDBC Gateway object. EnsLib.SQL.OutboundAdapter instantiates this automatically and stores a reference to it in ..%Connection.%JGProxy // Prepare the SQL statement Set pHS=..%JGProxy.prepareStatement(..%ConnHandle,pSQLStatement) // executeParametersBatch expects tArgs to be a $LIST, with the following format: // ParamCount, ParamSets, Type1, Param1, Type2, Param2, Type3, Param3, Type11,Param11… TypeNN,ParamNN // // ParamCount is the number of parameters the query expects (in this example 2) // ParamSets is the number of rows we will be inserting in this batch // Type1, Type2, ..., TypeN is an integer indicating the JDBC data type for the corresponding Param value (e.g. Param1, Param2, ..., ParamN) // Param1, Param2, ..., ParamN is the value for the query parameter set nbParam = pParms(1,1) set nbBatch = pParms(1) set $LIST(tArgs,1)=nbParam // How many parameters ("?") in it set $LIST(tArgs,2)=nbBatch // We will insert nbBatch rows in this batch set i = 2 for k=1:1:nbBatch { for l=1:1:pParms(1,k){ set i = i +1 set $LIST(tArgs,i)=12 // The JDBC data type for varchar is 12 set i = i +1 set $LIST(tArgs,i)=pParms(1,k,l) // Value for column Field1VarChar } } // Perform the batch insert // tResultCodes is a $LIST of integers indicating success/failure for each row in the batch set tResultCodes = ..%JGProxy.executeParametersBatch(pHS,tArgs) //Todo, Read list set pNumRowsAffected = $LISTLENGTH(tResultCodes) set pNumRowsAffected = nbBatch // Remove Statement to avoid CURSOR Leaks set sc = ..%JGProxy.removeStatement(pHS) k tArgs } catch exp{ Set tStatus = exp.AsStatus() } Quit tStatus }
My guess is that you are concatenating string with the operator "&" (AND) instead of "_".
If you do so, ObjectScript will cast your string as boolean false, the result of (false and false and false) equals 0, the result you see in your question.
Method PatientInfo(ID As %String) As %Status
{ #dim status as %Status=$$$OK
SET myquery="SELECT GUID, IDType,IDValue FROM MergeHyland.TypeTwoDimesionCollection WHERE GUID ="_ID
SET rset=##class(%ResultSet.SQL).%Prepare(myquery,.err,"")
WHILE rset.%Next() {
WRITE !,rset.GUID _ ":" _ rset.IDType_ ":" _ rset.IDValue
}
WRITE "End of data"
return status
}Hi Benjamin,
In some cases we have to use Ensemble as an ETL not an ESB.
So we extract lot of data, transform and load them throw the JDBC SQL Adapter in EnsLib. To do so, we dont do it line by line throw messages but ResultSet by ResultSet (one ResultSet can have more than 500 000 lines and 30 colones). This pattern work well.
But we have start to have time treatment issue. Our process took more than 8 hours. When we analyze it, what it cost time is the select and insert treatment.
We solved the problem of select treatment with this post : https://community.intersystems.com/post/jdbc-large-query-optimisation
So now, we are looking for a way to improve insert time. Our guess is to implement throw JDBC SQL Adapter in EnsLib the java pattern with PrepareStatement.addBatch() then executeBatch().
Do you have any idea to improve the insert treatment ?
Hi Eduardo,
My comprehension of your use of Git and Ensemble is that all devs build on the same sever like this :

This is not the way to go.
I recommend to use this model where every devs have there own server :

Hi Marc,
I'm intereded by your sample code for this kind of optimisation even if we have to use a different EnsLib.SQL.GatewayResultSet. Furthermore, we are currently looking for the same kind of optimisation in the other way, insert in JDBC batch mode. (https://www.tutorialspoint.com/jdbc/jdbc-batch-processing.htm) I get in touch with our Sales Engineer and we will continu to discuss this by email.
When we will have improvement, i'll update this theard.
Hi, Have you try to type your SQL parameters :
I hope this will help you.