#1 Re: mORMot 1 » Can I safely increase MAX_SQLTABLE when the database is in use? » 2022-02-11 13:28:39

I see, thank you, guess i should make a new TSQLRestServer then

#2 mORMot 1 » Can I safely increase MAX_SQLTABLE when the database is in use? » 2022-02-10 14:47:15

Codorna
Replies: 3

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.

#3 Re: mORMot 1 » Multiple tables update, how to use TransactionBegin properly? » 2021-02-11 00:52:13

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?

#4 Re: mORMot 1 » Multiple tables update, how to use TransactionBegin properly? » 2021-01-29 20:30:48

Project is already too big (1200+ tables), sometimes I have to run SQL directly too

#5 mORMot 1 » Multiple tables update, how to use TransactionBegin properly? » 2021-01-29 14:20:27

Codorna
Replies: 6

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!

#6 mORMot 1 » Using mORMOt as a http client of a non-mormot web api » 2020-01-31 20:31:58

Codorna
Replies: 1

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.

#7 Re: mORMot 1 » Access Violation when running a query with a huge ammount of data » 2019-11-22 14:27:26

So, apparently strings in delphi are limited to 2GB even on 64bits, any idea what could be done?

#8 Re: mORMot 1 » Access Violation when running a query with a huge ammount of data » 2019-11-22 12:33:28

It is on x64, it'd be tons of work to go around that, I often do need more than that in memory

#9 Re: mORMot 1 » Access Violation when running a query with a huge ammount of data » 2019-11-21 19:54:10

error happens on TTextWriter.AddString at the

    {$ifdef FPC}Move{$else}MoveFast{$endif}(pointer(Text)^,B[1],L);

line

#10 Re: mORMot 1 » Access Violation when running a query with a huge ammount of data » 2019-11-21 19:50:51

Delphi, x64 , i'd get "Out of Memory" on x32

delphi 10.3 now, but I also tried using delphi 10.2

#11 Re: mORMot 1 » Access Violation when running a query with a huge ammount of data » 2019-11-21 18:26:35

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

#12 mORMot 1 » Access Violation when running a query with a huge ammount of data » 2019-09-27 17:49:35

Codorna
Replies: 8

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

#13 mORMot 1 » TSQLTableJSON Step thread safety » 2019-09-17 18:21:26

Codorna
Replies: 1

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)

#14 Re: mORMot 1 » Access Violation (AV) on TSQLRecord.GetID » 2019-08-30 19:16:35

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

#15 mORMot 1 » Access Violation (AV) on TSQLRecord.GetID » 2019-08-30 12:38:36

Codorna
Replies: 2

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

#17 mORMot 1 » How do I set a HTTP timeout to an interfaced service call? » 2019-01-03 12:18:22

Codorna
Replies: 2

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.

#18 mORMot 1 » Right way to work with T*ObjArray as a TSQLRecord property » 2018-11-09 02:26:23

Codorna
Replies: 1

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;

?

#19 mORMot 1 » Is it possible to store an array as JSON on SQLite? » 2018-07-21 20:48:27

Codorna
Replies: 1

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

#20 Re: mORMot 1 » Context on URL » 2018-06-29 11:53:02

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.

#21 mORMot 1 » Context on URL » 2018-06-26 20:04:48

Codorna
Replies: 1

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.

Board footer

Powered by FluxBB