omer · Feb 11, 2025 go to post

Trying to set  %response.ContentLength in the OnPreHTTP() did NOT work...
Also part of the problem is that some responses has the response header "transfer-encoding: chunked"

which prevents having ContentLength anyway, but that is a different problem. 
The %resposne.ContentLength doesnt change the actual value

omer · Feb 4, 2025 go to post

so what would be the correct way to achieve this?

omer · Jan 28, 2025 go to post

in your snippet, myTable(name, counter)
name and counter are the fields you want to look out in myTable?

and thank you for your answers!

omer · Jan 22, 2025 go to post

But the problem with version checking is that it only increments, what about the part that some updates needs to decrement the counter? 
 

omer · Jan 22, 2025 go to post

and at what point will i be able to see the actual data? 
I checked the stream on the Post/Pre hyperEvent/Http functions on the CSP page class but couldn't get to the stream itself, 
it seems i need to find the exact point where the stream is loaded?

omer · Jan 22, 2025 go to post

The  DOC link you sent doesn't show even if i login... So hard to see if this will help.

omer · Jan 22, 2025 go to post

But what happens when i want to decrement it? 
the counter in my application can and will be decremented. 
if i use this it will only ever increment it.

omer · Jan 20, 2025 go to post

The Traces won't do for me as i need to access the data before it is sent back to the client, Seeing the trace afterwards is not what im looking for...
Also I couldn't find any method on the CSP.Page that provide the data i am looking for..

omer · Jan 20, 2025 go to post

Just as @Enrico Parisi 
said, It seems this works for inserts but not for UPDATES which is what i am looking for here..

omer · Jan 20, 2025 go to post

I don't think this will help, How would i get the counter from the Getter method? 
The counter is per row - i don't have a lot of rows that i can sum up, so this will not work...

omer · Jan 16, 2025 go to post

I have tried overriding several of the Methods of CSP.Page, But it seems that %response comes empty.

omer · Jan 15, 2025 go to post

Yes but that's not what I am after, I want to access the data im about to send in my code, so i can modify it, and run additional code on it.

omer · Jan 14, 2025 go to post

Thank you for your comments! 
It really clarified what i needed. 
 

omer · Jan 13, 2025 go to post

And in case i just directly access globals?
for example a simple code such as:

s ^myTracker("onSomething") = ^myTracker("onSomething") + 1

would that line above be handled by intersystems safely or not?

omer · Oct 29, 2024 go to post

I tried it, did not work, It seems that the code used to manually take and compile the parent class, And then compile the class we are on. This does not work as the 
Right now even if I manually take the parent class and compile it still won't work.
scenario 1:
when manually taking the parent class and trying to compile it, it would then compile its child and fail there (presumably because the child compiled in parallel to the parent causing the Method or Property undefined)
scenario 2: 
when trying to compile the class with the "ckr" flag, it would tell us the class was compiled successfully but in reality the class won't be compiled as we go inside it in studio we see it required compilation still.

omer · Oct 6, 2024 go to post

Hey after further testing I encountered a problem.

When trying to run a routine from within a method using the terminal, it would execute the argument in our terminal scope and not in that classMethod context, For example:

ClassMethod test()
{
    s arg = "asd"
    s routine = "say^hello(arg)"
}


then in terminal: 
s arg = "ddd"
d ##class(something).test()


output:
ddd
and NOT asd as you would expect...
any help on this topic?

omer · Oct 6, 2024 go to post

This works really well, Thank you for your elaborated answer!

omer · Jun 27, 2024 go to post

Thx for the replay, 
1. the problem with checking the header is that it can be toyed with, if someone changes header to say 1kb and sends 4mbs i will check header and let it pass...
I will check about 2 and 3, thx!

EDIT: checked about 2 - something like size property doesn't exist, the maximum you can do with a request is iterate through all the data inside and get its total *length of characters* which is still far from the request size in mbs

omer · Apr 24, 2024 go to post

As commented below:
The logic lies in the design of the system i am working on.
Simply put, i would kill a reference to an object only in case i would WANT to aggressively kick any place that tries using this object after i killed it. It is done only on very specific occasion.

So basically it's used as a last resort  because in some places, And although i understand in theory i could add a property and i would turn it off if i want the reference "killed" and just check that property, This is one of the options that came up.

omer · Apr 24, 2024 go to post

The logic lies in the design of the system i am working on.
Simply put, i would kill a reference to an object only in case i would WANT to aggressively kick any place that tries using this object after i killed it.
It is done only on very specific occasion.

omer · Feb 20, 2024 go to post

Indeed i have gotten to the same conclusion, I have decided to bubble up this problem and solve it with a different approach. Thx!

omer · Feb 13, 2024 go to post

Indirectly i can override the getter. The flow is this:
1. In the datatype i write a Get() method

2. in the class i have a Property prop As %MyDataType
3. i compile and the function Get from the data type gets compiled as propGet() inside my class
As you can see this is a very indirect way to override a Get method of any property with that datatype. (and it works, But i am having problems doing the same for the Set)
And my intention is to create a datatype that is also relevant to RegisteredObjects, That is why LogicalToStorage for example doesn't really suit me. 
If i have a RegisteredObject class then i won't save to storage anyway..
And while i understand i am using the Datatype not as intended this is the only way to make what i need.