#1 Re: mORMot 1 » DateToIso8601 changed ? » 2015-07-07 16:28:12

ab wrote:
  Info := Server.ExecuteFmt([TSQLInfoTable],
        'SELECT * FROM InfoTable WHERE Datum >= ? and Datum <= ?',[],[DateToSQL(D),DateToSQL(D+6)]);

ehh, i cannot use ExecuteFmt like this?

the result of ExecuteFmt is Boolean, I need TSQLTableJSON

#2 Re: mORMot 1 » DateToIso8601 changed ? » 2015-07-06 19:17:23

ab wrote:

Use ? parameters

also with ? parameters i only get a result with DateToIso8601Text

DateToIso8601 gives no result any more

#3 Re: mORMot 1 » DateToIso8601 changed ? » 2015-07-05 18:28:57

var
  S: RawUTF8;
  D: TDateTime;
  Info: TSQLTableJSON;

before this was OK
  S := ('Datum >= ' + DateToIso8601(D, False)       + ' and ' +
        'Datum <= ' + DateToIso8601((D + 6), False));
  Info := Server.ExecuteList([TSQLInfoTable],
        S2U('SELECT * FROM InfoTable WHERE ') + S);

Now need to use DateToIso8601Text within ""
  S := ('Datum >= "' + DateToIso8601Text(D)     + '" and ' +
        'Datum <= "' + DateToIso8601Text(D + 6) + '"');
  Info := Server.ExecuteList([TSQLInfoTable],
        S2U('SELECT * FROM InfoTable WHERE ') + S);

#4 Re: mORMot 1 » GetJSONValues doesn't work » 2015-07-05 18:25:35

yes, the result is OK ,  :-)

thank you very much

#5 mORMot 1 » DateToIso8601 changed ? » 2015-07-05 09:20:25

Bojop
Replies: 6

when i use DateToIso8601 in a Query, i alway's got a result

from commit 1536 I get no result any more

when I change DateToIso8601 to DateToIso8601Text and put it between "" then i get my result again.

does this mean that i had to change al my DateToIso8601 (to DateToIso8601Text and between "") or is there an issue with DateToIso8601 ?

#6 Re: mORMot 1 » GetJSONValues doesn't work » 2015-07-05 09:09:25

Again i have an issue wit GetJSONValues, I am getting no values.
I get an error on line 21606 from mORMot, "access violation". (i use latest commit 1593)

I changed most of my GetJSONValues calls to RetrieveListJSON, that works verry well.
But RetrieveListJSON can only handle one Table and also the Where part is limited, so is ORDER not allowed.

So i need GetJSONValues when i use more table's

do I need to add something or is something broken?

#7 Re: mORMot 1 » GetJSONValues doesn't work » 2015-05-12 13:45:47

ab wrote:

I've fixed a regression in TSQLTable.GetJSONValues.
See http://synopse.info/fossil/info/e477bcb533

yes, the result is OK again,  smile
thank you very much

ab wrote:

But IMHO you should try to use TSQLRest.RetrieveListJSON() method directly.
No need to use a temporary TSQLTableJSON storage.

I didn't know this one, it is indeed easier.

#8 Re: mORMot 1 » GetJSONValues doesn't work » 2015-05-12 09:39:07

TSQLDienst = class(TSQLRecord)
  private
    fNaam            : RawUTF8;
    fVoorNaam      : RawUTF8;
    fTussenVoegsel: RawUTF8;
    fNummer        : Int32;               // uniek = stored False {to make unique }
    fPloeg            : TPloegSoort;      // (8)
    fFunctie          : TOpFunctie;       // (7)
    fPosten          : TPosten;
    fTime            : TDateTime;        // date + time of record change
  published
    property Naam            : RawUTF8     read fNaam            write fNaam;
    property VoorNaam      : RawUTF8     read fVoorNaam      write fVoorNaam;
    property TussenVoegsel: RawUTF8     read fTussenVoegsel write fTussenVoegsel;
    property Nummer        : Int32          read fNummer         write fNummer stored False; // made unique
    property Ploeg            : TPloegSoort read fPloeg              write fPloeg;
    property Functie         : TOpFunctie   read fFunctie            write fFunctie;
    property Posten          : TPosten       read fPosten            write fPosten;
    property Time            : TDateTime   read fTime              write fTime;
  end;


//values with latest commit (only first 4 rows, rest I deleted)
//value of T
('ID', 'Naam', 'VoorNaam', 'TussenVoegsel', 'Nummer', 'Ploeg', 'Functie', 'Posten', 'Time',
'1', 'N1', 'V1', nil {#0}, '544', '5', '5', '768', '2012-06-15T18:25:31',
'2', 'N2', 'V2', '', '854', '4', '1', '627', '2014-12-13T08:14:49',
'3', 'N3', 'V3', nil {#0}, '338', '5', '3', '1584', '2012-09-26T17:03:40',
'4', 'N4', 'V4', '', '196', '4', '2', '1650', '2013-09-09T14:54:01', ........

//value of u
'{"fieldCount":9,"rowCount":143,"values":
["ID","Naam","VoorNaam","TussenVoegsel","Nummer","Ploeg","Functie","Posten","Time",
,"N1","V1",null,,,,,"2012-06-15T18:25:31",
,"N2","V2","",,,,,"2014-12-13T08:14:49",
,"N3","V3",null,,,,,"2012-09-26T17:03:40",
,"N4","V4","",,,,,"2013-09-09T14:54:01", .........

now al number values even the ID value are not returned, just get nothing


//old
//values with commit {1304} and older (only first 4 rows, rest I deleted)
//value of T
('ID', 'Naam', 'VoorNaam', 'TussenVoegsel', 'Nummer', 'Ploeg', 'Functie',
'Posten', 'Time',
'1', 'N1', 'V1', nil {#0}, '544', '5', '5', '768', '2012-06-15T18:25:31',
'2', 'N2', 'V2', '', '854', '4', '1', '627', '2014-12-13T08:14:49',
'3', 'N3', 'V3', nil {#0}, '338', '5', '3', '1584', '2012-09-26T17:03:40',
'4', 'N4', 'V4', '', '196', '4', '2', '1650', '2013-09-09T14:54:01', ........

//value of u
'{"fieldCount":9,"rowCount":143,"values":
["ID","Naam","VoorNaam","TussenVoegsel","Nummer","Ploeg","Functie","Posten","Time",
1,"N1","V1",null,544,5,5,768,"2012-06-15T18:25:31",
2,"N2","V2","",854,4,1,627,"2014-12-13T08:14:49",
3,"N3","V3",null,338,5,3,1584,"2012-09-26T17:03:40",
4,"N4","V4","",196,4,2,1650,"2013-09-09T14:54:01", .......

here al number values are returned also the ID value, with correct values

So, how do I get the number values back?

#9 Re: mORMot 1 » GetJSONValues doesn't work » 2015-05-11 21:09:35

i use
  u: RawUTF8;
  T: TSQLTableJSON;

T := Server.ExecuteList([TSQLDienst], S2U('SELECT * FROM Dienst'));
u := T.GetJSONValues(False);

#10 mORMot 1 » GetJSONValues doesn't work » 2015-05-11 20:34:06

Bojop
Replies: 9

GetJSONValues gives only tekst values, the number values are converted to Null or nothing at all.
this happens with update c55e03ca6d{1305} at 6-5-2015.
with update/commit {1304} the conversion was still OK.

do I need to add something or is something broken?

#11 Re: mORMot 1 » Leaks in SynSQLite3 » 2013-01-08 14:07:07

Hi Ab,


ab wrote:

Huge refactoring to circumvent the compiler bug...
See http://synopse.info/fossil/info/7ff2f00300

Still a record, so can be allocated on the stack.
Just some inlined methods to access to the nested TDynArray record.

after this i got these errors and i use XE

[DCC Error] SynCommons.pas(2617): E2184 PROTECTED section valid only in class types
[DCC Error] SynCommons.pas(3014): E2184 PROTECTED section valid only in class types
[DCC Fatal Error] SynSSPIAuth.pas(61): F2063 Could not compile used unit 'SynCommons.pas'

#12 Re: mORMot 1 » Breaking change: SQLite3*.pas units renamed mORMot*.pas » 2012-12-10 21:15:59

ab wrote:

I wonder if it could not be a good idea to add a thread id column in the logs.
It could help the viewer to be multi thread ready, and more useful on server side for instance.
What do you think?

Yes, I think that is a good idea.

#13 Re: mORMot 1 » Breaking change: SQLite3*.pas units renamed mORMot*.pas » 2012-12-10 18:44:43

Hi Ab,

ab wrote:

You seem to use several exceptions interceptors at once.

Try to use only one.

I don't use exceptions interceptors afaik.

I have no errors with

  with TSQLLog.Family do
  begin
    Level := LOG_VERBOSE;
    PerThreadLog := False;
    DestinationPath := 'L:\Log\Server\SQL\';
  end;

I have errors when

    PerThreadLog := True;  

but with the latest source code from today  10-12-2012 16:18  all errors are gone.
So, thank you very much.

#14 Re: mORMot 1 » Breaking change: SQLite3*.pas units renamed mORMot*.pas » 2012-12-09 20:12:38

Hi Ab,

Latest source now compiles fine, thanks.

For my problem, I cannot find the cause.

With the source code from 03-12-2012 13:53 my program runs fine without errors.

With the source code from 04-12-2012 17:27 and all newer source code my program runs and stop with error's.

With the source code from 09-12-2012 09:46 the error's are:
Client: Invalid fake .... interface call     and stops at line 28102 in mORMot
First chance exception at $7760FC56. Exception class EInterfaceFactoryException with message 'Invalid fake ICheckHaalPloegListInfoJSON.HaalPloegListInfoJSON interface call: : '. Process PloegPlaatje.exe (5020)
Log:
20121209 20401948 EXC           EOSError ("System Error.  Code: 12152.\r\n") at 00022209 SysUtils.RaiseLastOSError  stack trace API 00107A30 SynCommons.SynRtlUnwind (28726)

Server: EAccessViolation    and stops at line 10751 in SynCommons
First chance exception at $7760FC56. Exception class EAccessViolation with message 'Access violation at address 004CD08C in module 'PloegNak3.exe'. Read of address 6F6C706D'. Process PloegNak3.exe (5324)
Call Stack:
SynCommons.StrLen(???)
SynCommons.TTextWriter.AddNoJSONEscape($6F6C706D,0)
SynCommons.TSynLog.AddRecursion(1,sllEnter)
SynCommons.TSynLog.DoEnterLeave(sllEnter)
SynCommons.TSynLog._AddRef
:0040a768 @IntfCopy + $C
mORMotHttpServer.TSQLHttpServer.Request('/root/Dienst?session_signature=xxxxxxxxxxxxxxxxxxxxx','BEGIN','Accept: */*'#$D#$A'Content-Type: application/json; charset=UTF-8'#$D#$A'User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows; FREE)'#$D#$A'Host: xxxx_xxxxxx:xxx'#$D#$A'Content-Length: 0'#$D#$A'Connection: Keep-Alive'#$D#$A'Cache-Control: no-cache'#$D#$A'Pragma: no-cache'#$D#$A'RemoteIP: x.x.x.x'#$D#$A,'','application/json; charset=UTF-8','','','')
log: a lot of this
20121209 20495656  -        …À|F;urê3À_^]Â 00.106.621
20121209 20495656  -    00007759 System.@FinalizeArray  00.106.627
20121209 20495656  +    000FE909 mORMot.TSQLRestServer.URI (21904)
20121209 20495656  +        …À|F;urê3À_^]Â

20121209 20392926  +    001147FB SynSQLite3.TSQLDatabase.DBClose (3791)
20121209 20392926  -    00114887 SynSQLite3.TSQLDatabase.DBClose (3804)  00.001.789
20121209 20392926 EXC   ECrtSocket ("Socket bind creation error on 0.0.0.0:xxx (10048)") at 0017D480 SynCrtSock.TCrtSocket.OpenBind (1355)  stack trace API 000E1C70 SynCommons.SynRtlUnwind (28726) 000055C8 System.@HandleAnyException 0017D480 SynCrtSock.TCrtSocket.OpenBind (1355) 0017D2C7 SynCrtSock.TCrtSocket.Bind (1313) 0017E204 SynCrtSock.THttpServer.Create (2114) 00183D66 mORMotHttpServer.TSQLHttpServer.Create (406) 00184040 mORMotHttpServer.TSQLHttpServer.Create (435) 00192998 PloegServer.TRotaServer.Create (3674) 00192B45 PloegServer.MakeServer (3742) 00005C30 System.@StartExe

20121209 20401947  +    000FE909 mORMot.TSQLRestServer.URI (21904)
20121209 20401947  +        20121209 20401947 EXCOS     EAccessViolation (C0000005) at 000CC08C SynCommons.StrLen (10751)  stack trace API 000E1C70 SynCommons.SynRtlUnwind (28726) 000055C8 System.@HandleAnyException 00009768 System.@IntfCopy 00184239 mORMotHttpServer.TSQLHttpServer.Request (490) 0018207D SynCrtSock.THttpServerGeneric.Request (3973) 0017E42D SynCrtSock.THttpServer.Process (2208) 0017EBC7 SynCrtSock.THttpServerResp.Execute (2348) 00043F91 Classes.ThreadProc 0000602E System.ThreadWrapper
20121209 20401947  -    000FFE91 mORMot.TSQLRestServer.URI (22330)  00.000.190


After disable all logging calls to TSQLLog, my program runs fine again without errors.

do you know what is the cause?

#15 Re: mORMot 1 » Breaking change: SQLite3*.pas units renamed mORMot*.pas » 2012-12-07 18:04:21

Hi Ab,

source stil won't compile

[DCC Error] mORMot.pas(5697): E2439 Inline function must not have open array argument

#16 Re: mORMot 1 » Breaking change: SQLite3*.pas units renamed mORMot*.pas » 2012-12-07 17:44:16

ab wrote:

I just launched the regression tests with all logging included.

All interface-based service code run as expected, and the logs where written with no problem (more than 280 MB just for the TTestServiceOrientedArchitecture and TTestExternalDatabase tests).

Without code to reproduce the issue, nor a more complete error message (what is the FULL error message associated with the exception?) difficult to guess what is wrong.
Please download the latest version from the repository... code is evolving very quickly, so line numbers are not useful for me. wink

latest source won't compile

[DCC Error] SynCommons.pas(4390): E2439 Inline function must not have open array argument

i use XE

can i sent you the logging file's?

#17 Re: mORMot 1 » Breaking change: SQLite3*.pas units renamed mORMot*.pas » 2012-12-07 16:51:37

Hi ab,

Bojop wrote:

when running my program i get an exception after calling an service for the second time.
The first time the service runs with no error.

Exception class EInterfaceFactoryException
program stops at line 27925 in Mormot with latest Source Code

With the latest source code the error with building my source is gone, but the exception remains.

this happens with all service calls, first time OK, second time gives exception.


on the server side i get an EAccesViolation, program stops at line 29343 in Syncommons.
when I disable all the logging, the program runs without an error?

#18 Re: mORMot 1 » Breaking change: SQLite3*.pas units renamed mORMot*.pas » 2012-12-07 13:14:57

Hi ab,

ab wrote:

With which compiler?


I use XE

when running my program i get an exception after calling an service for the second time.
The first time the service runs with no error.

Exception class EInterfaceFactoryException
program stops at line 27925 in Mormot with latest Source Code

With the latest source code the error with building my source is gone, but the exception remains.

this happens with all service calls, first time OK, second time gives exception.

#19 Re: mORMot 1 » Breaking change: SQLite3*.pas units renamed mORMot*.pas » 2012-12-04 21:56:42

Hi,

ab wrote:

The revision 1.18 is on track and will contain all files.
I'm just waiting for feedback before freezing the code.


I get this error when building with latest source code

[DCC Warning] mORMot.pas(27878): W1036 Variable 'V' might not have been initialized

#20 mORMot 1 » after Backup no virtual table exist » 2012-10-28 19:26:53

Bojop
Replies: 1

before running a backup
the value in TSQLRestServer.fStaticVirtualTable is : nil,nil,nil,nil,$17BD6D0,nil,nil,nil,nil,nil,nil

i run the backup with

  Server.BackupGZ(BackupFileName);             

after running the backup
the value in TSQLRestServer.fStaticVirtualTable is : nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil

the virtual table is gone?

how can i solve this?

#21 Re: mORMot 1 » Assertion failure in SQLite3Commons » 2012-04-16 21:13:00

I changed my code.
Now it runs OK.

thank you

#22 mORMot 1 » Assertion failure in SQLite3Commons » 2012-04-15 21:11:36

Bojop
Replies: 2

I got this assertion failure error in SQLite3Commons

destructor TServiceFactoryClient.Destroy;
begin
  if fSharedInstance<>nil then begin
    Assert(TInterfacedObjectFake(fSharedInstance).fRefCount=1);                             // gives assertion error
    TInterfacedObjectFake(fSharedInstance)._Release; // bonne nuit les petits
  end;
  if fFakeStub<>nil then
    VirtualFree(fFakeStub,0,MEM_RELEASE);
  inherited;
end;

how can i avoid this?

#23 Re: mORMot 1 » service problem with XE » 2012-04-06 08:51:48

it is OK, now

thanks for the fix

#24 mORMot 1 » service problem with XE » 2012-04-05 19:40:03

Bojop
Replies: 2

when trying to implement the service i got an 'Access violation'

after commenting out line 23103 and 23105 in SQLite3Commons it is OK

//        {$ifdef ISDELPHIXE2}
        inc(PW); // skip attributes
//        {$endif}

I am using XE

can you fix this?

thank you

#25 Re: Source Code repository » SQLite3 engine updated to version 3.7.11 » 2012-03-24 12:28:17

array81 wrote:

What mean " You need to recompile the c sources."?


In SQLite3 subdir you need to run c.bat to create the obj files

#27 Re: mORMot 1 » Problem with data in a grid » 2011-01-10 20:31:34

Yes, it is different in XE.

OK, that's nice, thank you for the new function.

#28 mORMot 1 » Problem with data in a grid » 2011-01-10 11:22:26

Bojop
Replies: 5

Hello,

Very nice framework.

I am trying the sample programs.
When added a grid I ran into a problem.
The text or integer values in a grid are displayed one char shorter than the original value.
So, an integer value 0 to 9 is not shown in the grid. Also not in the ID column.

I changed in SQLite3Commons

function TSQLTable.GetWP(Row, Field: integer; Dest: PWideChar; MaxDestChars: cardinal): integer;
var P: PUTF8Char;
begin
  P := Get(Row,Field);
  result := Utf8ToUnicode(Dest,MaxDestChars,PAnsiChar(P),StrLen(P))-1;
end;

to

  result := Utf8ToUnicode(Dest,MaxDestChars,PAnsiChar(P),StrLen(P));

with presents the correct data in the grid.

I only don't know if this will give other problems.

Board footer

Powered by FluxBB