You are not logged in.
Pages: 1
I see, thank you, guess i should make a new TSQLRestServer then
Mine is at 256 and I'd like to change do 512 because danm brazilian laws. Is it safe?
Edit: It's mORMOt 1, I forget to say.
sometimes i mix both, I use the ORM as much as I can but sometimes I need to do some complex queries, it's a single user per db tho
I will do like
fRest.TransactionBegin(TXXX, 1);
try
fRest.ExecuteFmt('update XXX set y = z', [], []);
xxx := TXXX.CreateAndfillPrepare(...)
try
some specific updates
then sql again with some complex joins using TSQLTableJSON
then commit
how screwed am I?
Project is already too big (1200+ tables), sometimes I have to run SQL directly too
Should I use a transaction for every table passing the table as parameter on each or can I just do something like
rest.TransactionBegin(TSQLRecord, 1);
try
update table1
...
update tablen
rest.commit(1)
exception
rest.rollback(1);
end;
What is the proper way?
Thanks!
How could I be able to do that? I've been using indy and i'd really like to know if it would be possible to use mORMOt's SOA interface classes for it.
So, apparently strings in delphi are limited to 2GB even on 64bits, any idea what could be done?
It is on x64, it'd be tons of work to go around that, I often do need more than that in memory
error happens on TTextWriter.AddString at the
{$ifdef FPC}Move{$else}MoveFast{$endif}(pointer(Text)^,B[1],L);
line
Delphi, x64 , i'd get "Out of Memory" on x32
delphi 10.3 now, but I also tried using delphi 10.2
This keeps happening, when querying something over ~2gb I get an AV
raised exception class $C0000005 with message 'c0000005 ACCESS_VIOLATION'.
if there's less data, same code works.
it's just a:
json := fServer.RetrieveListJSON(fClass, StringToUTF8(fFormatSQLWhere), fBoundsSQLWhere);
fServer being a TSQLRestServerDB
I've gotta run a query that has a lot of results, millions, ~70 columns, it's all on sqlite.
res := fProps.ExecuteInlined(aSQL,aExpectResults);
the AV ends up happening there:
procedure Movex64; // A. Bouchez' version
asm .noframe // rcx=Source, rdx=Dest, r8=Count
mov rax, r8
sub rcx, rdx
je @11
jnc @03
add rax, rcx
jc @17
@03: cmp r8, 8
jl @09
test dl, 07H
jz @06
test dl, 01H
jz @04
mov al, byte ptr[rcx + rdx]
dec r8
mov byte ptr[rdx], al
add rdx, 1
@04: test dl, 02H
jz @05
mov ax, word ptr[rcx + rdx]
sub r8, 2
mov word ptr[rdx], ax <---- this line
before AVing the software allocates ~2 gb of RAM
I seldom get this error on my IDE when using a direct sql (service is on per thread) and TSQLJSONTable
tableResult := TSQLTableJSON.Create(sql, fSQLServiceEFD.Execute(sql, true, false));
try
while tableResult.Step(False, @r) do
(...)
raised exception class ESQLite3Exception with message 'Error SQLITE_MISUSE (21) [bind_text] using 3.29.0 - not an error, extended_errcode=0'
I've also seen extended_errcode = 100
doesn't happen on single thread execution (I'm using a Parallel.ForEach from omnithread)
I free it later, that list in the for is the one retrieved by RetrieveList , I already fixed changing the SQLRecord to TID and loading on another field, gonna try TID(object) next time, thanks
I got a table with a 1:1 reference to another and when retrieving values, when the Id is too high, I'm getting an AV, what should I do ? The ID is over $100000 and this messes up the ORM
on the TSQLRecord:
property reg : TReg0200 read fReg write fReg; //this is another TSQLRecord
loading data:
...
RetrieveList<TAgrupamentoConsistencia>('', []);
...
for obj in list do
obj.reg := TReg0200.Create(Server, obj.reg.Id);
also tried obj.reg , obj.reg.AsTSQLRecord
Thank you, great idea.
I got an interface with a ping command among others
(interface was already defined with fPipeClient.ServiceDefine)
service := fPipeClient.Services[fServiceName];
if service <> nil then
if service.Get(I) then
result := I.ping;
I need this I.ping to be quick, like, if no answer in 10 millisecs just return false, I have not found a timeout property.
Thanks.
Since I can't do a ObjArrayAdd(object.array, new) what's the best way?
Do I have to:
var
A : array;
Begin
A := object.array;
ObjArrayAdd(A, new);
Object.array := A;
End;
?
I've been searching for it but I couldn't find an answer, would it be possible to store it as JSON instead of BLOB?
from what I've read, TObjectList would store it as json, but would add a class: property that I don't want, and i've never worked with Collections, TDocVariant would be problematic for me since I like the type-safety.
If I can't do with an array what would be the best way to have it type safe while storing it as a json?
Thanks
Anyone?
I'm not sure if I was clear enough but the main problem is I need the same service connecting to different databases, that must possibly be created at runtime.
I've been using mormot for some interface based services for a while, and there's a new project I have to do that I just don't know how I should be doing it,
I'd like to have a server controlling a lot of different databases, the database would be in the URL, example :
localhost:8080/root/db1/customers
localhost:8080/root/db2/customers
localhost:8080/root/db3/customers
...
The problem is that I don't know the names of those dbs, if they don't exist they should be created at runtime.
Idea would be an interface,
ISampleFunctions = interface ...
TSampleFunctionsService = class(ISampleFunctions) ...
What could be done? Override Process, and then create the TRest/TSQL at run time ? but how could I then redirect it?
Thank you.
Pages: 1