#1 Re: mORMot 1 » Access violation using ServiceRegister with client » 2022-09-12 12:43:48

Sorry, I don't understand you.

From client side you need to do something like that (extracted from sample 14):

...
Client := TSQLHttpClient.Create('localhost', PORT_NAME,Model);
Client.ServiceDefine([ICalculator],sicShared);

And service is prepared to be consumed from client:

...
if Client.Services['Calculator'].Get(I) then
    writeln(IntToStr(I.Add(a,b));

#2 Re: mORMot 1 » Access violation using ServiceRegister with client » 2022-09-12 11:01:31

I guess you have something misunderstood.
Is this on server side or client side ?

I think the documentation it's very very clear.

#3 Re: mORMot 1 » dead link » 2022-07-25 12:15:20

a question mark is missing before "post/2013/12/10/JSON-record-serialization"

The correct url is:
https://blog.synopse.info/?post/2013/12 … ialization

#4 Re: mORMot 1 » Get instance of service » 2022-07-08 12:42:54

You can obtain i.e. when calling .ServiceDefine:

var ServiceFactoryServer : TServiceFactoryServer;
    InstanceOfTServer : IServer;
...
ServiceFactoryServer := Server.ServiceDefine(TServer, [IServer], sicShared);
ServiceFactoryServer.Obj(InstanceOfTServer);

If you also want to access to a TSQLRestServer instance simply change class definition by the following

TServer = class(TInjectableObjectRest, IServer)

See Implement your service from TInjectableObjectRest

Note: IMHO your naming in your example it's a little confusing

#6 Re: mORMot 1 » mORMot 2 in Good Shape » 2021-01-22 11:43:32

It's amazing!! Just one word in my language:
B R A V O!!!!
smile

#7 Re: mORMot 1 » Renaming TSQLRecord to TORM » 2020-10-28 14:54:25

ab wrote:

To sumup, the prefix are the following:
- TSyn* for core types
- TRTTI* for RTTI
- TOrm* for ORM process
- TRest* for REST process
- TInterface* for interface process
- TService* for service process
- TNet* THttp* TWebSockets* for communication
- and so on...

So I guess it won't be a good idea to get rid of the TSyn* prefix.

I'm fully agree with this pattern @ab. It's very semantic, consistent and furthermore the simpler the better.
IMHO TSyn* for all types is not necessary at all. When we use some type (ie TOrm), you are in a "bounded context" where each type has its meaning in the context of its domain.
If there is a conflict, there are several easy solutions.

#8 Re: mORMot 1 » Rename a column with mORMot » 2020-06-02 17:49:57

This is great!
Have you any trick regarding remove a column from an SQLite table?

#10 Re: mORMot 1 » Authentication » 2020-05-22 09:45:42

Great!
So what would you specifically improve on this point for a better future understanding and thus improve the current documentation?

#11 Re: mORMot 1 » Authentication » 2020-05-21 12:24:08

Please, read the great documentation where it is perfectly explained. Refer to this section

#12 Re: mORMot 1 » open source project- really? » 2020-02-13 08:32:41

Yes Johnnysynop, I read the thread two times,  have you read the answers?

With all my respects to you, I think the first step to solving any conflict for all parts it's to get things clear:

  • The work and support given by @ab in this project it's 'UltraExcellent'. Nothing to say. It's not an opinion. It's a fact.

  • The definition provided was to get a 'common sense' what is an 'open source project'

  • So sorry but I love definitions :-) (extracted from Wikipedia):

    In Internet slang, a troll is a person who starts quarrels or upsets people on the Internet to distract and sow discord by posting inflammatory and digressive,[1] extraneous, or off-topic messages in an online community (such as a newsgroup, forum, chat room, or blog) with the intent of provoking readers into displaying emotional responses[2] and normalizing tangential discussion,[3] whether for the troll's amusement or a specific gain.

Please, I think it's extra justified that you change the title of this thread.

Many many thanks for your comprehension and have a nice day

#13 Re: mORMot 1 » Can Mormot write a Pascal class in code based on a database table? » 2020-02-12 11:42:05

IIRC there's no automatic procedure to do this task. But IMHO it's not much work to do with 34 tables->classes and you can adapt, map, improve, etc... some classes to fit ORM. It was for me a good point to read first ORM is not Database

#14 Re: mORMot 1 » open source project- really? » 2020-02-12 11:32:07

Open Source Software definition (extracted from Wikipedia):

Open-source software (OSS) is a type of computer software in which source code is released under a license in which the copyright holder grants users the rights to study, change, and distribute the software to anyone and for any purpose.[1] Open-source software may be developed in a collaborative public manner . Open-source software is a prominent example of open collaboration.[2]

IMHO you should/must to change the title of this thread to be more accurate. Thanks!.

#15 Re: mORMot 1 » ISQLDBRows and memory » 2020-01-28 11:30:04

Yes @ab, but if the call is not in the main thread you have to call:

fProps.EndCurrentThread;

IIRC in SQL server you have to proceed as stated.

#16 Re: mORMot 1 » ISQLDBRows and memory » 2020-01-27 09:52:09

IMHO it's something related regarding some databases drivers needs to free connection in each thread that you create it, therefore you should call 
.EndCurrentThread in each call. Something like this:

...
var SQLDBConnection : TSQLDBConnection;
begin
  SQLDBConnection:=fProps.NewConnection;
  try
    ...
  finally
    SQLConnection.Free;
    fProps.EndCurrentThread;
  end; 
end;
  

#17 Re: mORMot 1 » Keep session from expiring » 2020-01-25 23:23:00

This behavior is controlled by SessionTimeout  per sessión established in TSQLAuthGroup as documented here

Even you can react to an authentication error through as documented here

#18 Re: mORMot 1 » Relay server scenario » 2020-01-14 12:33:21

But, if I've understood it correctly, why not simply open a port in the office redirected to the server using an httpS protocol (end-to-end encryption as it was designed) and use the mORMot secure RESTful authentication?

What it would be the actual mission of the 'relay' for you?

#19 Re: mORMot 1 » Kingdom Driven Design principles » 2019-09-30 20:09:19

Obviously, you're not alone Eugene :-)
But IMHO we should wait after 28th October...
It looks great!

#20 Re: mORMot 1 » Raising http 400 in Interface-Based Service » 2019-06-18 13:50:11

Hi,
If I'm not wrong, the way to return custom response it's via TServiceCustomAnswer record type.
Please check related section in documentation for further details.

#21 Re: mORMot 1 » Using mORMot to create a client connecting to an existing webservice » 2019-02-07 14:58:27

I think there are some mistakes in your code. Please, see below a https authorization example of the Asana API:

    http := TWinHttp.Create('app.asana.com','443',true);
    try
      Status := http.Request('/api/1.0/tasks',
                             'POST',0,
                             FormatUTF8('Authorization: Bearer %',[fPersonalAccessToken]), 
                             VariantSaveJson(Json),
                             '',ResHeader,ResData);
    finally
      http.Free;
    end;

In case to send a POST request to a http webservice:

    http := TWinHttp.Create(HostName,'8888',false);
    try
      Status := http.Request(FormatUTF8('/things/link/%',[ThingCode]),
                             'POST',0,
                             'Content-Type: application/json'+#10+'Accept: application/json', 
                             json,
                             '',ResHeader,ResData);
    finally
      http.Free;
    end;

 
Please read the incredible documentation to get further details.

#22 Re: mORMot 1 » Access to MVC application from another device » 2018-11-28 11:17:26

I think this is an issue related with windows firewall or antivirus.
Please, first check locally
· http://192.168.xxx.xxx:8092/<root defined>/timestamp
· or http://192.168.xxx.xxx:8092/<root defined>/mvc-info

then disable firewall and any antivirus and check from another computer same urls.
If it works, create an exception in firewall and enable again, and recheck it.
If the issue persists, please publish the results.

Hope it help

#23 Re: mORMot 1 » Advice to switch from mORMot authentication to ADFS 3.0... » 2018-04-17 16:43:47

Sorry, but I'm not able to see the function of IIS in this case.
The purpose is to switch from mORMot authentication to Microsoft Active directory Federation Services.

#24 Re: mORMot 1 » Advice to switch from mORMot authentication to ADFS 3.0... » 2018-04-16 15:22:09

AFAIk, this is valid for a logged user or domain member, but if the domain are not reachable is when ADFS makes sense.

#25 mORMot 1 » Advice to switch from mORMot authentication to ADFS 3.0... » 2018-04-16 14:52:48

xalo
Replies: 4

Currently, client-server via interfaces with mORMot authentication are implemented with awesome performance and realiability, and I need to switch to ADFS authentication model to achieve single sign on.

Any suggestion will be welcome

#26 mORMot 1 » Possible little bug in TSQLTableToGrid.SetCustomFormatByType... » 2018-02-22 12:59:49

xalo
Replies: 0

I've found in TSQLTableToGrid.SetCustomFormatByType or TSQLTableToGrid.CustomFormat when Fieldtype is sftCreateTime or sftModTime the output is not the expected.

I think the issue is in the following code in mORMotUI.pas:

      case Table.ExpandAsString(ARow,ACol,Client,StringValue,GetCustomFormat(ACol)) of
      // very fast response (calculated once)
      sftBoolean:
        // display boolean as checkbox
        DrawCheckBox(TDrawGrid(Owner).Handle, Handle, Rect,
          PWord(Table.Get(ARow,ACol))^<>ord('0')); // fast StrComp(,'0')
      sftInteger, sftFloat, sftCurrency,
      sftEnumerate, sftTimeLog, sftRecord,
      sftDateTime, sftDateTimeMS, sftUnixTime, sftUnixMSTime:
        ExtTextOut(Handle, Rect.Left+XInc, Rect.Top+2, Options, @Rect, pointer(StringValue),
          length(StringValue), nil); // translated short text

and it should be: (I've added sftCreateTime, sftModTime)

      case Table.ExpandAsString(ARow,ACol,Client,StringValue,GetCustomFormat(ACol)) of
      // very fast response (calculated once)
      sftBoolean:
        // display boolean as checkbox
        DrawCheckBox(TDrawGrid(Owner).Handle, Handle, Rect,
          PWord(Table.Get(ARow,ACol))^<>ord('0')); // fast StrComp(,'0')
      sftInteger, sftFloat, sftCurrency,
      sftEnumerate, sftTimeLog, sftCreateTime, sftModTime, sftRecord,
      sftDateTime, sftDateTimeMS, sftUnixTime, sftUnixMSTime:
        ExtTextOut(Handle, Rect.Left+XInc, Rect.Top+2, Options, @Rect, pointer(StringValue),
          length(StringValue), nil); // translated short text

Many thanks in advance

#27 Re: mORMot 1 » Change type field » 2018-02-12 15:22:28

Great and perfect suggestion!
This solves the weird results. I've changed TRawUTF8DynArray by variant field type and field name and now works like a charm.

I'm so grateful with you... and with the mORMot,of course! ;-)

#28 Re: mORMot 1 » Change type field » 2018-02-11 17:22:01

I'm agree @ab that is a nigthmare changing TSQLRecord field...

There is any way to check in SQLite3 if some field has multi-type in a column?
I have some weird behabiours in BLOB fields related to TRawUTF8DynArray for some records only, as you stated.

Any suggestion to intercept wich field I could have changed type in the past and solve the issues?

#29 Re: mORMot 1 » CreateAndFillPrepare doesn't work in TSQLRestServerFullMemory... » 2016-11-26 16:35:13

ok!...but is so so so fast!!! :-(
Maybe it would be possible apply only one condition for prepare, and the second one through a fillone iterating.

Really really good framework!
Awesome!

Many thanks

#30 mORMot 1 » CreateAndFillPrepare doesn't work in TSQLRestServerFullMemory... » 2016-11-25 16:26:58

xalo
Replies: 4

Hi,
With the following code, it doesn't work in a TSQLRestStorageInMemory REST storage, but in TSQLRestServerDB works like a charm:

 TSQLiniDB = class(TSQLRecordVirtualTableAutoID)
 private
    fSeccio : RawUTF8;
    fCamp : RawUTF8;
    fValor : RawUTF8;
 published
    property Seccio : RawUTF8 read fSeccio write fSeccio;
    property Camp : RawUTF8 read fCamp write fCamp;
    property Valor : RawUTF8 read fValor write fValor;
 end;
...
...
var
 ModelSettings : TSQLModel;
 SettingsDB : TSQLRestServer;
...
...
procedure ORMInit;
begin
  ModelSettings := TSQLModel.Create([TSQLiniDB]);
  ModelSettings.VirtualTableRegister(TSQLiniDB,TSQLVirtualTableJSON);
  SettingsDB := TSQLRestServerFullMemory.create(ModelSettings,'settings.json',false,false);
end;
...
...
var ORMiniDB : TSQLiniDB
      Seccio,Camp,Valor:string;
begin
      Seccio := 'General';
      Camp := 'Path';
      Valor := 'c:\';
      ORMiniDB := TSQLiniDB.CreateAndFillPrepare(SettingsDB,'Seccio=? AND Camp=?',[StringToutf8(Seccio),StringToUTF8(Camp)]);;
      try
          ORMiniDB.FillOne;
          ORMiniDB.Seccio := StringToUTF8(Seccio);
          ORMiniDB.Camp := StringToUTF8(Camp);
          ORMiniDB.Valor := StringToUTF8(Valor);
          SettingsDB.AddOrUpdate(ORMiniDB);
      finally
        ORMiniDB.Free
      end;
end;

Even the pair fields 'Seccio' 'Camp' exists, AddOrUpdate adds a new register instead of update. In a sqlite database storage it works well.
Is there something wrong?

Many thanks

Board footer

Powered by FluxBB