You are not logged in.
Did you make any changes to the mormot library when started with Rio ?
I'm using mORMot with 10.3.2 for a couple of weeks. Everything works fine. Didn't meet any trouble while migrating from 10.3.1.
Delphi 10.3.2 Professional with Mobile Version 26.0.34749.6593
unfortunately it doesn't help
Have someone used mormot with 10.3.2 ?
there were some other compile errors which I fixed myself
like adding syntable to the uses list in SynDBUniDAC.pas ([dcc32 Error] SynDBUniDAC.pas(222): E2003 Undeclared identifier: 'ftInt64')
Thanks , but not .
I use latest build.
Gets
error E2065: E2065 Unsatisfied forward or external declaration: 'CodecGetReadKey'
error E2065: E2065 Unsatisfied forward or external declaration: 'sqlite3_key'
and few more declaration without implementation .
I verified sqlite3.obj does exist
tried use c.bat to compile but bcc32 does not exist with this delphi version .
using bcc32x instead failed to compile
Hi,
couldn't figure how to authenticate pure javascript or react on synopse server .
a working example would be much appreciated ( delphi server side and javascript client side)
Is it possible to implement login with sms message?
updating AuthUserRT with temporary time limited password (which was sent to the end user)
If , for some reasons , I have a plain password on the server side ,
How can I verify it against the TSQLAuthUser.PasswordHashHexa ?
Do you have an example of how doing that ?
Thanks
But as I understand this will allow the remote server access to the login table on the main server .
The remote server shouldn't have any access to the actual AuthUser table ,
Authentication request on the remote server should trigger the check on the main server without 'sharing' the table with the remote server .
Is it possible ?
I have few servers which only one of them should handle Authentication .
(all other servers are logged to the Authentication server)
is it possible that when server gets Authentication request from the client he will redirect it to the Authentication server ?
if the server gets positive answer from the Authentication server he will allow the session .
Is it possible that on failed setuser request the server will be able to response with an error message ( 'incorrect password'/'user expired'....) ?
Hi ,
I noticed an exception occurs in TSQLRestServer.SessionDelete
sometimes Ctxt in nil , causing an exception on the log command .
Also , the library wouldn't compile when removing the WITHLOG directive .
{$ifdef WITHLOG}
fLogFamily.SynLog.Log(sllUserAuth,'Deleted session %/% from %/%',
[User.LogonName,IDCardinal,RemoteIP,Ctxt.Call^.LowLevelConnectionID],self);
{$endif}
is there an event exposed by the server which I can use ?
In the terms of the example , I maintain a list of the 'TLongWorkServiceThread' in order to inject them notifications when needed .
when the connection is suddenly broken, how can I know that ?
Following the example LongWorkserver/client , how does the server can detect client disconnection ?
Thanks ab,
Thats a great help .
I would like to make sure I understand the usage correct architure .
If I have s synopse ORM server who serve 5,000 concurrent users (synopse delphi clients ) whom I want to push 'random' notifications .
Each client logged in will create kind of 'TLongWorkServiceThread' on the server which will be active as long as the client logged .
Is it the right way ( in terms of server resources cpu/memory) to keep all those threads active (although doing nothing most of the time) ?
Can the library be used also for simple client/server UDP communication ?
If yes , which classes should be used ?
Thanks Arnaud,
I'm also waiting for an example .
I'm trying to understand how to use it from the regression tests .
I downloaded the latest build but it fails with those errors :
2.1. Bidirectional remote connection:
- Websockets JSON protocol: 60 assertions passed 24.28ms
- Websockets binary protocol: 240 assertions passed 4.67ms
- SOA callback on server side: 2,234 assertions passed 361.09s
- Run http server: 1 assertion passed 20.78s
! Bidirectional remote connection - SOA callback via JSON websockets
! Exception EInterfaceFactoryException raised with messsage:
! TInterfacedObjectFakeClient.FakeCall(IBidirService.TestCallback) failed: 'URI
root/BidirService.TestCallback/2 [-4,2] returned status 404'
! Bidirectional remote connection - SOA callback via binary websockets
! Exception EInterfaceFactoryException raised with messsage:
! TInterfacedObjectFakeClient.FakeCall(IBidirService.TestCallback) failed: 'URI
root/BidirService.TestCallback/4 [-4,2] returned status 404'
Using mORMot 1.18.1117 FTS3
Running on wSeven_64 with code page 1255
Generated with: Delphi XE2 compiler
Time elapsed for all tests: 426.69s
Tests performed at 23/03/2015 11:45:37
Total assertions failed for all test suits: 1 / 6,413,873
! Some tests FAILED: please correct the code.
Done - Press ENTER to Exit
Great ...
Do you have a sample project to demonstrate how it should be used ?
Is it possible to implement push notifications (server to client) without polling the server ?
can TServiceCustomAnswer be extended to return more then one binary object ?
I need the orm server to return record which contains more fields in addition to the blob one.
Is there other ways to make the server return mixed data ?
if , for example I have a response record like
TResponseRecord = record
blob1:RawByteString;
blob2:RawByteString;
simpleString:string;
number:integer;
end;
maybe should be another layer which pack TResponseRecord into TServiceCustomAnswer on the server side and extract it back to TResponseRecord on the client side ?
Thanks
Hi ,
Do you have a simple example of how doing that ?
I saw you have JSONToXML function in SynCommons is the other way exist somewhere else ?
Can I feed mustache with XML data instead of json ?
Can I encrypt only some of the requests and not all of them ? (The server will decide when)
I'm afraid it will decrease performance.
Currently I'm using mormot with microsoft MsSql ,
I thinking of moving the database into Azure .
Does mormot work with Azure sql ?
Thanks, you are great .
you forgot to change
ContentSize := -1;
TO
ContentSize := FieldSize;
inside SetFieldType
suppose the longest first_name in the json database was 'ab' ,
after I converted it to Tdataset the column size would be 2 and I wouldn't be able to insert value longer than two characters .
I'm using TSQLTableJSON and convert it to Tclientdataset .
the field size in Tclientdataset is automatically defined by the json column content length ,
The current value length shouldn't be the maxsize of the dataset column.
I'm using SetFieldType to define the column type for the created dataset , how can I control the size also ?
Thanks,
Any idea about the nulls translated to zeros ?
Another problem with that :
Null datetime values are translated to zeros in the Tclientdataset instead of null , that makes the grids display 30/12/1899 instead of empty column .
How can we solve that ?
Thanks , it works .
As I understand the TSQLTableJSON is automatically freed when I free TSynSQLTableDataSet (when use CreateOwnedTable with Table<>nil ), am I right ?
You have small compilation error under XE2
function JSONToDataSet(aOwner: TComponent; const aJSON: RawUTF8;
const ColumnTypes: array of TSQLFieldType
{$ifndef UNICODE}; aForceWideString: boolean=false{$endif}): TSynSQLTableDataSet; overload;
{$ifdef HASINLINE}inline;{$endif}
[DCC Error] mORMotVCL.pas(158): E2439 Inline function must not have open array argument
Thanks ab,
But
on the client side I get json string from server and immediately convert it to dataset ,
The client doesn't know the exact fields order and therefore can't pass the matching column type array .
can you create constructor with Tpair<fieldname,fieldtype> array or TDictionary or callback function resolveFieldType(p_fieldName:string):TSQLFieldType
The problem is that the dataset is created by jsonTodataset .
Maybe you can add OnColumnCreated event/callback to jsonTodataset.
it will allow to specify the column type instead of guessing by value .
On the client side I use devexpress grid expecting tclientdataset .
I get the data from server (external MSsql) as json and using JSONToDataSet to convert it to dataset
with this process I loose the field column type which makes me problems with displaying dates and booleans .
Anyway to add the json string the column type and parse it when building the dataset ?
How can I convert PasswordHashHexa into plain password ?
I modified sampel14 server to demonstrate
/// this server will use TSQLRestServerFullMemory over HTTP
program Project14ServerHttp;
{$APPTYPE CONSOLE}
uses
SysUtils,
Classes,
SynCommons,
mORMot,
mORMotHttpServer,
Project14Interface;
type
TServiceCalculator = class(TInterfacedObject, ICalculator)
public
function Add(n1,n2: integer): integer;
end;
Tclass = class
function sessionCreated(Sender: TSQLRestServer; Session: TAuthSession; Ctxt: TSQLRestServerURIContext):boolean;
end;
function TServiceCalculator.Add(n1, n2: integer): integer;
begin
result := n1+n2;
end;
function Tclass.sessionCreated(Sender: TSQLRestServer; Session: TAuthSession; Ctxt: TSQLRestServerURIContext):boolean;
begin
result := true;
end;
var
aModel: TSQLModel;
aServer: TSQLRestServer;
aHTTPServer: TSQLHttpServer;
aclass : Tclass;
begin
// define the log level
with TSQLLog.Family do begin
Level := LOG_VERBOSE;
EchoToConsole := LOG_VERBOSE; // log all events to the console
end;
aclass := Tclass.create;
// create a Data Model
aModel := TSQLModel.Create([],ROOT_NAME);
try
// initialize a TObjectList-based database engine
aServer := TSQLRestServerFullMemory.Create(aModel,'test.json',false,true);
try
aServer.OnSessionCreate:= aclass.sessionCreated;
// register our ICalculator service on the server side
aServer.ServiceRegister(TServiceCalculator,[TypeInfo(ICalculator)],sicShared);
// launch the HTTP server
aHTTPServer := TSQLHttpServer.Create(PORT_NAME,[aServer],'+',useHttpApiRegisteringURI);
try
aHTTPServer.AccessControlAllowOrigin := '*'; // for AJAX requests to work
writeln(#10'Background server is running.'#10);
writeln('Press [Enter] to close the server.'#10);
readln;
finally
aHTTPServer.Free;
end;
finally
aServer.Free;
end;
finally
aModel.Free;
end;
end.
Ok ,thanks,
If we are already talking about interface , how do I register a service to be used only on the server side and not exposed to the client ?
aServer.ServiceRegister(Trt_mangr,[TypeInfo(IrtMng_1)],sicShared);
aServer.ServiceRegister(Trt_mangr,[TypeInfo(IrtMng_2)],sicShared);
IrtMng_1,IrtMng_2 are interfaces to the same Trt_mangr object
IrtMng_1 is used from the client
IrtMng_2 should be used from other units on the server only
I can't find that http://synopse.info/fossil/info/f23a869a36
on the last build, why ?
Can this library can be used to convert multipage tiff file into pdf ?
This is broken on the client side
it isn't in the main thread and used for uploading/downloading data in the background .
What's the property name on the client for request timeout
I noticed that in interface calls if the call takes longer then 30 seconds it is droped by the client .
Where can I configure this timeout .
I tried to increase keepAlive but it doesn't help .
I created that service to check it
ITests = interface(IInvokable)
['{0214C711-E14B-4D86-B418-B48553EDA24C}']
function test_wait(p_mili:integer):integer;
end;
TTests = class(TInterfacedObject, ITests)
public
function test_wait(p_mili: integer): integer;
end;
function TTests.test_wait(p_mili: integer): integer;
var
speedTester:TspeedTester;
begin
speedTester.start;
my_sleep(p_mili);
result := speedTester.elapsed;
end;
type
TspeedTester = record
private
startTime: int64;
public
procedure start;
function elapsed: int64;
function elapsedSTR: string;
end;
implementation
{ TspeedTester }
function TspeedTester.elapsed: int64;
begin
result := GetTickCount - startTime;
end;
function TspeedTester.elapsedSTR: string;
begin
result := inttostr(elapsed);
end;
procedure TspeedTester.start;
begin
startTime := GetTickCount;
end;
Tclientdataset is common in client/server applications .
when you need pure Tclientdataset , it would be usefull to have JSONToClientDataSet .
Can I register already exist object in ServiceRegister in sicShared mode ?
where do I find the updated SQLite3VCL.pas , it doesn't exist in the nightlybuild
I need json to Tclientdataset converter .
Why there are two functions ?
If I'm adding SQLite3VCL to my uses I get compilation errors in SQLite3Commons .
[DCC Error] SQLite3Commons.pas(2313): E2037 Declaration of 'WriteObject' differs from previous declaration
Thanks,
I will try to migrate my TDBXReader usage to SynDB units .
As I understand TSQLDBConnectionProperties.ExecuteInlined is thread safe and I need only one instance of TSQLDBConnectionProperties on the server side . Am I right ?
Thanks,
But if I have an old code returning TDBXReader , do you have a fast converter from TDBXReader to RawJSON ?