go to post Warlin Garcia · Jun 24, 2019 Which value did you modify? The pool size takes couple values into account.Which connection pooling are you using? If using default boot one it's Hikari and the value to change should be maximumPoolSize
go to post Warlin Garcia · Jun 24, 2019 The default value for connection pool size on boot is usually 10. You may want to set this value to 1 or 2 for testing purposes (if using the IRIS community version).
go to post Warlin Garcia · Jun 3, 2019 The confusion here is that you created 3 class mappings for a single global (not a good practice) and your understanding is that they're just "views", however the 3 of them are full class/tables with the same properties/ownership of the data. With that in mind, using SQL DROP statement has the same effect for any of the 3 tables/classes (if DDL were allowed). As others have pointed out, you can accomplish what you're trying to do with DROP %NODELDATA or by removing the class definition (either from Studio or programatically). If you wanted to declare views instead of tables then you need to do so via SQL CREATE VIEW statement.
go to post Warlin Garcia · May 2, 2019 One variation to #1 would be to pass an object. It provides for readability (assuming property names are legible) and would allow for flexibility if you need to add a new parameter in the future (method signature doesn't need to change).
go to post Warlin Garcia · Mar 7, 2019 I like them in the following order:1) Class Queries2) Dynamic Queries3) Embedded SQLThere was a time when Embedded SQL were way faster than dynamic queries, however I think that's not that different anymore. The readability provided by dynamic queries (especially for people new to Cache) outweighs the performance embedded SQL could provide. Of course each situation is different and maybe your application might benefit greatly from that extra performance.One "drawback" from embedded SQL is that if it's used within routines you need to [manually] compile those routines when pushing changes for a class/table that is part of the embedded SQL. This is true even if those new changes doesn't directly affect that routine or embedded SQL. Classes are compiled automatically depending on the flags you use when compiling the affected table otherwise you need to [manually] compile them as well.
go to post Warlin Garcia · Feb 13, 2019 You can remove the Calculated keyword and use a combination of SqlComputeOnChange and Readonly keywords.What you accomplish:- Removing Calculated keyword, makes the column persistent- Adding SqlComputeOnChange gives you control on when you want the value to be calculated (using %%INSERT or %%UPDATE) and based on which column (don't add any if calc must happen for all inserts regardless of which fields are being inserted).- Adding Readonly just provides and extra "safety" that the value can't be changed via SQL or Object means. Property readonlyprop As %String [ ReadOnly, SqlComputeCode = { S {*} = {ID}_(+$H)}, SqlComputed, SqlComputeOnChange = %%INSERT ];
go to post Warlin Garcia · Jan 30, 2019 Can you provide what you get from this command set sc=res.Prepare(sql,,conn)? The error should tell you why the query failed preparation.
go to post Warlin Garcia · Oct 25, 2018 I'm not sure there's a Cache specific document for designs like this. There are multiple ways to separate data in any database (schema, instance, namespaces, etc). Cache provides extra features such as namespace mappings that makes sharing simpler but before you get to Cache specific implementation you need a high level design of your application. Regardless of database and programming language, how should my application work? How do you plan to sell your product? How flexible you want it to be? As Dmitry pointed out, are there any regulations/limitations around sharing data within customers? All this should be based on your business model and has nothing to do with technology stack.
go to post Warlin Garcia · Sep 20, 2018 Even SQL operations are captured in the journals as far as my understanding goes. But I'd agree any solution would have to check on any scenarios such as data not being journaled since processes can disable journaling "at will". Journaling can also be disabled at the db level.Going under the assumption that "everything" is captured in the journals it should be possible to write a process that reads the journal file and convert its entries to another format.
go to post Warlin Garcia · Sep 20, 2018 For Cache/IRIS, the JOURNAL files would be the closest option to CDC. There isn't any "generic" product out there that can read and publish the content on journal files for things like streaming or other uses. You can certainly write something to read and publish/stream the changes but it'll be a customized option. Cache/IRIS can do it internally for Cache-to-Cache sync/mirroring so it is possible to follow the same logic for other uses. Maybe check with Intersytems if they have had request lake this before. Either they already have a utility or can help you build one.
go to post Warlin Garcia · Aug 17, 2018 Besides dynamically changing the maxlen what else are you trying to accomplish/avoid? These values are used at compile time to generate the SQL catalog and become part of your contract (for clients calling them). If you were to dynamically change the values 1) you'll be breaking the contract (e.g. you could change the values to a more restrictive size) and 2) you would still need to compile the class holding the stored proc/query. The benefit I can think of this approach right now is avoiding pushing code to prod (assuming that process is cumbersome), however you still need the compile part. It'll be better to define and modify the stored proc using DDLs (maybe a faster change in prod depending your company's rules). Since this change is a database object change it should be treated as code and thus (hopefully) kept in source control (for audit and replication purposes).
go to post Warlin Garcia · Aug 14, 2018 Agree on your "usefulness" statement. Making a class non-extendable breaks all recommended development practices. For example TDD. I won't be able to mock this class for testing purposes and will be forced to test with your class only (Granted Cache is not strong typed so in theory I have ways to bypass this limitation but still). Another recommended principal is to use composition instead of inheritance so in theory I could do exactly the same I wanted to do with your class (after you "lock it down") by making it part of another class without extending it. If a developer wants to get around your class ( don't know the reasons why) he/she can by other means unless you plague your code with a bunch of type checks (making Cache strong typed). Even if a developer get to extending your class, the fact you can't overload methods in Cache gives you a level of restriction when combined with deployed code and final as there's "no way" a developer can change your implementation so your code will still call your methods' implementation on a subclass.All and all it seems you're going to extremes for no real benefit but since we don't know the whole picture maybe this effort is worth it.
go to post Warlin Garcia · Aug 13, 2018 Is ClassDefinition available even if you deploy without the source code e.g. OBJ version?
go to post Warlin Garcia · Jul 2, 2018 Code placement depends on what you're trying to do and when: if processing the event from javascript (ajax call) then your code must be separate from OnPreHTTP(); if processing on the server (after page submit) then your code should be in OnPreHTTP() or called from it (this last part depends on your coding style - jam everything in a single method or separate things in multiple smaller methods)In simple terms (as Robert pointed out) , OnPreHTTP needs to handle any processing the server must perform prior to "displaying"/"printing" the page on the browser.
go to post Warlin Garcia · May 30, 2018 Correct. The alternative using TextReader was to "avoid" increasing memory but if you have that option then the answers provided by Timothy are the way to go.
go to post Warlin Garcia · May 30, 2018 Understand. I haven't tried this myself yet but in theory you should be able to initialize the Reader with an XML.Document object. This Document can be initialized (%OnNew) with a global of your choice in the same manner that TextReader can.
go to post Warlin Garcia · May 30, 2018 For large files I use %XML.TextReader.ParseFile(). It allows me to pass a "concrete" global instead of using Cache defaults. Usually CacheTemp which is more limited than a concrete global. With this I'm able to process larger files. Granted, it's a little bit of more work (code) as you have to traverse the results (element by element) but it gets the job done.
go to post Warlin Garcia · May 11, 2018 There's certainly a performance gap. The significance depends on what you're trying to do. For most jobs it'll be very very insignificant. In general SQL is a little bit faster than Object access, however Object access provides other benefits in terms of code clarity and reusability. In the case of interacting with Cache from other languages (e.g Java/Spring) then SQL will be preferred for lots of reasons. The main one being that SQL, as Robert Cemper said, it's a well supported and known language.
go to post Warlin Garcia · May 7, 2018 Do you mind sharing what are you trying to accomplish that you need a dynamic table creating mechanism?