#201 Re: mORMot 1 » Renaming TSQLRecord to TORM » 2020-10-30 03:04:40

macfly wrote:

@mdbs99
I am referring, that as it will be a new version of the framework, there is not so much problem in changing the name of all classes to prefix with TSyn.
Many have already changed and the refactoring is inevitable.

I understand and agree what you said. Now is a great (maybe only) time to decide on the prefix. And Prefixing all types with TSyn is a good choice.

#202 Re: mORMot 1 » Renaming TSQLRecord to TORM » 2020-10-29 07:25:51

ab wrote:

Your remark is purely rhetorical.
An official Delphi TOrm class won't be in SysUtils and other basic RTL units, so it won't affect our code.

It won't affect the mORMot code itself, but it affects we users of mORMot - because we might use both of those units.

Using a unified, short prefix for all types is a best practice that's been proven, to prevent existing and future conflicts.

As a strong example, If we use TSynTextWriter instead of just TTextWriter, it won't have been conflicted with System.Classes.TTextWriter.

#203 Re: mORMot 1 » Renaming TSQLRecord to TORM » 2020-10-28 10:03:14

pvn0 wrote:
ab wrote:

We will write for instance with mORMot 2:

type
  TOrmBlogArticle = class(TOrm)
  ...

.

Would prefer this :

type
  TBlogArticle = class(TSynORM)
  ...

I think I would prefer one common prefix for everything (TSyn* looks very good), for several reasons but mostly because in pascal, this has been the norm for libraries.

And you don't have to necessarily loose other prefixes, for example :

type
  TSynRecordRTTI = class(TSynRttiType)
  ...

I completely agree with you! `TSyn` for all types.

#204 Re: mORMot 1 » Renaming TSQLRecord to TORM » 2020-10-28 04:08:02

mdbs99 wrote:

edwinsn,
Some frameworks/libs use the same prefix for all types (e.g. Indy, TMS, JEDI, DevExpress, etc) but, even though it could minimize eventual collision names, it's not perfect as anyone can use the same prefix as other already has used.
It could be very verbose either. Imagine typing TMormotTextWritter or TMormotOrm (!!).
Simple names are better to read, however it could have colision... difficult decison.
However, in my opinion, if the framework/lib uses an abstract prefix (e.g. Id, Jv, dx, etc), it must be in all types. That is consistency.

Yes, we shouldn't use a prefix that's too long.

#205 Re: mORMot 1 » Renaming TSQLRecord to TORM » 2020-10-28 03:12:56

mdbs99 wrote:
ab wrote:

I have made another pass or types renaming in mORMot 2.
It sounds consistent everywhere now.

You may think renaming all TSyn* prefix too.

You remind me of some of the naming conflicts, such as TTextWritter - sometimes I have to use SynCommons.TTextWritter

#206 Re: mORMot 1 » Renaming TSQLRecord to TORM » 2020-10-26 17:42:25

My initial feeling is that, isn't mORMot follows the Active Record pattern? Then maybe record is easier to be understood?

#207 Re: mORMot 1 » Why TTextWriter.AddLine supports shortstring only? » 2020-10-23 05:47:45

OK, had to add a 'class helper' for TTextWriter, like the following:

procedure TTextWriterHelper.AddUtf8Line(const aLine: RawUtf8);
begin
  self.AddString(aLine);
  Self.AddCR;
end;

#208 Re: mORMot 1 » Why TTextWriter.AddLine supports shortstring only? » 2020-10-22 17:33:09

Sorry, but it's still not clear to me if I can pass a RawUTF8 string to the AddLine method? It compiles, and is it really OK? Thanks!

#209 mORMot 1 » Why TTextWriter.AddLine supports shortstring only? » 2020-10-22 14:34:53

edwinsn
Replies: 4

@ab,

I noticed the `TTextWriter.AddLine` method is defined as:

TTextWriter.AddLine(const Text: shortstring)

Why `shortstring` which is limited to 255 characters but not `RawUtf8`?

#210 Re: mORMot 1 » Adding parameters to interface functions in a backwards compatible way » 2020-10-22 12:07:39

@ab,

A little issue with using the methods on the client side:
- Called ServiceRegister then ServiceDefineSharedAPI, mORMot will complain about 'interface already registered'.
- use ServiceDefineSharedAPI only mORMot will complain about 'interface not registered'.
- Use "TServiceFactoryClient(ServiceRegister(...)).ParamsAsJSONObject := True" will cause  access violation

Not sure why. had to use the following code instead:

  svcFactory := (Services['ApiForClient'] as TServiceFactoryClient);
  svcFactory.ParamsAsJSONObject := True;
  svcFactory.ResultAsJSONObjectWithoutResult := True;

#211 Re: mORMot 1 » Offline records? » 2020-08-28 17:25:48

@ab,
I know, but I'm not discussing the OP's question, but my question is about the general master/slave replication feature of mORMot.

#212 Re: mORMot 1 » Offline records? » 2020-08-28 12:16:41

ab wrote:

Or you can use ORM master/slave replication and use the server as slave database.

What happens if the master server is down during the process of syncing? Can it persist the pending data and restart the syncing?

PS, I remember I posted a similar reply yesterday but somehow it disappeared...

#213 Re: mORMot 1 » TSQLRest.OneFieldValue with 'AND' » 2020-08-19 14:46:27

Use in-memory sqlite db instead - use :memory: as the db file name.

#214 Re: mORMot 1 » Adding parameters to interface functions in a backwards compatible way » 2020-08-14 05:19:36

This thread is useful. For the same requirement (backward compatibility), I had to gone further than you #4 option - I resorted to method-based service - everything is JSON and you'll have to process it.

#215 Re: mORMot 1 » Occasional sssues with SQLite dbs in OneDrive/Dropbox » 2020-08-07 07:22:20

@ab,

slepp(10) + retry loop sounds like the only solution worth trying at the moment...
Thanks!

#216 Re: mORMot 1 » Occasional sssues with SQLite dbs in OneDrive/Dropbox » 2020-08-07 06:42:22

ab wrote:

Are you able to open the file with a file viewer?
I guess the OneDrive file is not a real file, but a pseudo file, only accessible via the Internet Explorer.

Not sure about earlier versions of OneDrive, but recent versions of OneDrive is just like Dropbox, it's not a virtual drive but only a sub-folder of another physical drive such as D:\

I might didn't describe it clearly, but these kinds of issue only happens on occasional db files at occasional times - it not always happen. So yes, I can open those db files with other sqlite db file viewer, because the issues don't happen all the time.

#217 mORMot 1 » Occasional sssues with SQLite dbs in OneDrive/Dropbox » 2020-08-07 05:42:01

edwinsn
Replies: 4

Hello,

Update 1: Note, these kinds of issue happens on occasional db files at occasional times - it not always happen, but only sometimes.

Anybody experienced any kind of **occasional** issues that only happens when the SQLite database files are stored in OneDrive or Dropbox?
If **yes**, do you have any clue about how to fix the issue? Thanks!

The following is one of the problems I encountered:

exception class    : ESQLite3Exception
exception message  : Error SQLITE_IOERR (10) [DBOpen] using 3.32.3 with aDB=nil;

main thread ($d50):
00d8b393 +2c3 Program1.exe SynSQLite3          3911 +30 TSQLDatabase.Create
00d9a1ee +06e Program1.exe mORMotSQLite3        800  +1 TSQLRestServerDB.Create

The db file is something like: C:\Users\X360\OneDrive\file1.db

#220 Re: mORMot 1 » Query with 'FileName LIKE "%.%"' fails » 2020-07-22 08:46:38

Thanks for the comment, ab, I forgot about that :0

But I guess it's better if mORMot support escaping, for example, '\%' won't be treated as a parameter.

#221 mORMot 1 » Query with 'FileName LIKE "%.%"' fails » 2020-07-22 08:12:12

edwinsn
Replies: 4

Assume the TSQLRecord-derived class has a property called 'FileName'
This query clause:

FileName LIKE "%.%"

As in

db.Retrieve('FileName LIKE "%.%"', [], [True], theRecord)

Will fail (not raising errors but just don't return the correct result).

As a workaround I use 'InStr(FileName, ".")>0' insead, but it's an issue that needs to be fixed, I guess.

#222 Re: mORMot 1 » Build a "SaaS" solution using mORMot » 2020-06-22 13:40:17

This thread is a good read, thank you guys! The systemd socket activation is really interesting, the start-on-demand nature is similar to that of the 'serverless' (eg, AWS lambda) hype.

Not sure if Window server has the similar feature?

#223 Re: mORMot 1 » 10.4 sydney issues » 2020-06-10 03:43:28

Amazing work, ab!

You said "VFS is a lot of work" just few days ago, and you still finish it sooo quickly? big_smile tongue

#224 Re: mORMot 1 » 10.4 sydney issues » 2020-06-06 12:49:41

ab wrote:

I guess I would perhaps add read-only compression of an existing database.

Do you mean after the db's compressed, it'll become readonly?

#225 Re: mORMot 1 » 10.4 sydney issues » 2020-06-06 09:30:44

Thanks @utelle for the very insightful input! I guess @ab can benefit from it.

So far my impression is that a VFS layer is the way to go. I guess forking and adopting all upstream changes in the future will be a lot of work and more error-prone.

#226 Re: mORMot 1 » 10.4 sydney issues » 2020-06-05 17:03:45

Is there any way to ask the original SQLite author for help?

#228 Re: mORMot 1 » Will mORMot be sponsored by Embarcadero? » 2020-05-23 14:25:40

It seems to be a good thing if mORMot get sponsored!

#229 Re: mORMot 1 » Stable vs latest » 2020-05-22 09:20:50

berocoder wrote:

curious why not use this kind of development earlier.

Every project has its own growing path smile

#230 Re: mORMot 1 » Freeing Record created by CreateCopy w/ TRawUTF8List property cause AV » 2020-05-14 07:56:49

@Vitaly,
Alternatively you can use TStrings/TStringList as the published property type, you'll get JSON format in the db, and it doesn't have the 'CreateCopy' issue described here.

#232 Re: mORMot 1 » Freeing Record created by CreateCopy w/ TRawUTF8List property cause AV » 2020-05-13 12:47:46

But when being stored in the db, a field of type TRawUTF8DynArray is not in JSON format? Persisting in JSON format is required in my use case.

#233 Re: mORMot 1 » Revision 2.x of the framework » 2020-05-13 11:26:33

Hey! I've got one thing to add:

Do you plan to eliminate the use of the 'with' statement of the Object Pascal language?

Thanks.

#234 Re: mORMot 1 » Freeing Record created by CreateCopy w/ TRawUTF8List property cause AV » 2020-05-13 11:24:06

After some debugging I wonder it might has something to do with TSQLPropInfoRTTIObject.CopySameClassProp?

#235 mORMot 1 » Freeing Record created by CreateCopy w/ TRawUTF8List property cause AV » 2020-05-13 11:21:54

edwinsn
Replies: 9

@ab,

If you run this small test console project you'll get an EAccessViolation error
https://gist.github.com/edwinyzh/ea75bd … 3d59ee095f

The case is that a freeing a TSQLRecord-derived class which has a published property of type TRawUTF8List, created by CreateCopy, will cause the 'Access Violation' error.

Am I doing something wrong, is it by design, or is it a bug?

I'm using the latest mORMot rev:
https://github.com/synopse/mORMot/commi … 8b1605bf92

And the error also happens with previous versions.

#237 SynProject » Does SynProject contain some re-usable 'rtf to html' code? » 2020-05-09 16:14:20

edwinsn
Replies: 2

Hello ab,

It seems that SynProject can generate html document out of .rtf files?

I did a quick look at the source code, trying to extract some re-usable code for converting rtf code to html code, but no luck.

Can you point me to the right direction? Thanks!

#238 Re: mORMot 1 » Fast MM5 » 2020-05-09 05:35:01

emk wrote:

@ab,
I'm not using Linux yet, but THANK YOU! for your hard work and attention to detail.

Please be noted that fpcx64mm is **also for Windows** under FPC.

#239 Re: mORMot 1 » Fast MM5 » 2020-05-08 04:04:18

Mr. Bouchez,

You never cease to surprise us with your ability and fast speed!

#240 Re: mORMot 1 » Fast MM5 » 2020-04-30 16:48:42

Great! Just discovered it earlier.
It seems that there is a major change in licensing. I assume one can use the GPL license in a closed-source, commercial program?

#242 mORMot 1 » What if String properties of TSQLRecord suddenly changed to RawUtf8? » 2020-04-29 14:43:51

edwinsn
Replies: 2

Hello ab,

Lets say I have a TSQLRecord-derived record whose string properties are defined as 'String'.

Now if I changed the source code and all 'String' properties become 'RawUtf8', will error happen when reading back the record data from SQLite db?

Thanks.

#243 Re: mORMot 1 » Log dead-loop if exceptions occur repeatedly in EchoCustom » 2020-04-19 12:55:27

Thank you ab! The new `TSynLogFamily.ExceptionIgnorePerThread property` seems to be very helpful in such cases!

#244 mORMot 1 » Great news! » 2020-04-18 17:48:09

edwinsn
Replies: 1

Great news!

I just discovered that HeidiSQL - a full-featured, open source database manager **written in Delphi** now supports SQLite since several weeks ago!

Github repository: https://github.com/HeidiSQL/HeidiSQL

Even over 8 years ago when it supports only MySql I know it's already very feature rich!

The best part is that it's written in Delphi so we Delphi developers can enhance it by ourselves.

Maybe add support for mORMot's remote SQLite db?

#245 Re: mORMot 1 » Log dead-loop if exceptions occur repeatedly in EchoCustom » 2020-04-18 14:35:34

ok, worked it around using the good old approach - OnBeforeException - which is my little contribution wink

I ignores the exceptions by detecting the thread name.

But I still wish there is a global option for disabling TSynLog auto-capturing all the exceptions including those already wrapped by 'try...except', because even in the mORMot threads there are some exceptions I want to ignore...

#246 Re: mORMot 1 » Log dead-loop if exceptions occur repeatedly in EchoCustom » 2020-04-18 14:12:53

@ab,
I looked at the code in TSynLog.DisableRemoteLog, but such approach doesn't seem will work in my case, because my 'SMTP remote logging' works like this:

1 - My EchoCustom will not directly send the log entries but just push them to a TSynQueue.
2 - Then another thread will pull from the log queue and send them through SMTP one by one.

The exceptions happens in step 2 is what I want to ignore by TSynLog.

#247 mORMot 1 » Log dead-loop if exceptions occur repeatedly in EchoCustom » 2020-04-18 08:43:57

edwinsn
Replies: 5

Hello ab,

Few years ago I asked a question about how to make TSynLog on the server-side to ignore exceptions that happened inside a try...except block, and you opinion was that all exceptions should be logged.

Now I'm facing an issue that might change your view.

I have a log interception procedure (achieved via TSynLogFamily.EchoCustom) which emails out log entries through SMTP, and when the network is broken or something like that happen, never-ending logging will happen - TSynLog will log any exceptions happened in my "EchoCustom" procedure, and my "EchoCustom" will again trying to send that exception and another exception will happen due to the network issue.

I hope I described the issue clealry.

And a best solution for such cases would be to have an option to disable TSynLog (such as SQLite3Log) logging exceptions I want to ignore (using try...except without re-raising)

Thank you!

#248 Re: Free Pascal Compiler » FPC 3.2 rc1 » 2020-04-17 04:18:40

IIRC, some of the NewPascal features have been merged into the FPC trunk?

#250 Re: mORMot 1 » Thanks to all for mORMot/Zeos + Linux!!! » 2020-03-28 15:34:33

danielkuettner wrote:

But the moment where my little linux service was visible with its first requests in RemoteLog under my Windows- workstation was incomparable!

Thanks for sharing your migration experience! What "remote logging" mechanism are you using? I'm recently thinking of logging from mORMot to sentry.io.

Board footer

Powered by FluxBB