Recent

Author Topic: [SOLVED] mORMot Sample 30 MVC Server - still working?  (Read 9564 times)

ttomas

  • Full Member
  • ***
  • Posts: 225
Re: mORMot Sample 30 MVC Server - still working?
« Reply #15 on: July 21, 2021, 10:33:39 pm »
The question is and remains why there are sqlite3 errors when accessing a firebird FDB database.
In mORMot ORM part is based by using embedded sqlite. When you use external database like Oracle, MSSql, Firebird, etc., external tables are registered as VirtualTables in sqlite. This is in memory sqlite3 database. In this database you can mix real tables in sqlite and virtual tables in one or many external databases. You can even query between this tables in sqlite.
Error code is raised in method of registering this virtual tables in sqlite3, because ZeosLib can't connect to external Firebird database, missing fbclient or bad connection string.

@jeffp
SynDBZeos connector try to create firebird database only if you use Firebird embedded version(client), based of connection string (if you use only path to database without server/port for TCP connection). For Fb 2.5 you must use Embedded version (separate download).
If you use Server then firebird database is not created, this is by design for security reason.

jeffp

  • New Member
  • *
  • Posts: 15
Re: mORMot Sample 30 MVC Server - still working?
« Reply #16 on: July 22, 2021, 12:45:07 am »

@jeffp
SynDBZeos connector try to create firebird database only if you use Firebird embedded version(client), based of connection string (if you use only path to database without server/port for TCP connection). For Fb 2.5 you must use Embedded version (separate download).
If you use Server then firebird database is not created, this is by design for security reason.
@ttomas, thank you for clarifying this part. I foolishly assumed that embedded and server FB are handled similarly by mormot. I do not remember these design/feature being mentioned in the expansive mormot docs. Nevetheless, thanks again for pointing it out.

This is not mORMot issue, this is ZeosLib Issue. ZeosLib open and keep open transaction from connection. When you commit, new transaction is started. This transaction logic is the problem, this is logic like PostgreSQL and MySQL RDBMS work.
Is this still the case? Should I do something about it in my mormot/zeus app?

ttomas

  • Full Member
  • ***
  • Posts: 225
Re: mORMot Sample 30 MVC Server - still working?
« Reply #17 on: July 22, 2021, 11:18:09 am »
Is this still the case? Should I do something about it in my mormot/zeus app?
Yes all connections have started transaction.
Just use
Code: Pascal  [Select][+][-]
  1. Props := TSqlDBZeosConnectionProperties.Create( ...
  2. Props.ConnectionTimeOutMinutes:=15;
After 15min of inactivity connection pool will be destroyed and close all transaction/connections.

I do not remember these design/feature being mentioned in the expansive mormot docs. Nevetheless, thanks again for pointing it out.
Yes this is not documented, read the code
constructor TSqlDBZeosConnectionProperties.CreateWithZURL

jeffp

  • New Member
  • *
  • Posts: 15
Re: mORMot Sample 30 MVC Server - still working?
« Reply #18 on: July 22, 2021, 12:06:33 pm »
Yes all connections have started transaction.
Just use
Code: Pascal  [Select][+][-]
  1. Props := TSqlDBZeosConnectionProperties.Create( ...
  2. Props.ConnectionTimeOutMinutes:=15;
After 15min of inactivity connection pool will be destroyed and close all transaction/connections.
Hmm. Interesting. I am not sure if this is normal.
Now I am also trying the Postgresql samples. I hope there would be less issues here.

 

TinyPortal © 2005-2018