You are not logged in.
Pages: 1
Hi,
DBGrid/DBNavigator<-->DataSource<-->SqlDBClientDataSet
As shown in the UI framework above for user editing,
how to refresh the auto-increment field(TID) when the user added a record?
Many thanks in advance
make a correction, TUniDBNumberEdit ,not TDbedit
Hi ab,
TDbEdit(Real Field) <--> TSqlDBClientDataSet <--> TSQLDBSQLite3ConnectionProperties <--> SQLITE3
The Record real field be setted to null when dbEdit be setted empty, this is string 'null' not NULL.
the code file: mormot.db.sql
line 5948 : with TVarData(Data) do
case VType of
varEmpty,varNull:
.....
then all is ok.
The above issues is well sometimes,sometimes occured.
Writeln('hello word');
myhttpsvr := TTmyServer.Create;
try
Writeln('Press enter to close');
ConsoleWaitForEnterKey;
finally
Writeln('stopping...');
FreeAndNil(myhttpsvr);
Writeln('svr stoppeded.');
end;Sometimes showing
hello word
Press enter to close
...
20241118 08131854 + mormot.db.raw.sqlite3.TSqlDatabase(e741f0).DBOpen SQLCY.db
...Sometimes showing
...
20241118 08233147 http mormot.rest.http.server.TRestHttpServer(02f2a2e0) http.sys registration of http://+:7302//
hello word
Press enter to closeso, I may have some understanding now
hello!
I have a little console project rest server with mormot2, it can be deadlock some times(no any response when client connecting), it is good when keying enter key,What could be the possible reason?
I make source to service project , It's well.
No any waiting a key in my source.
Mormot 2.3, Delphi12.2
to assigned a datetype use cast ,Can be regarded as a good idea
geting a raise when query empty,but normal when not empty.
Above is my project: unigui+rest.
Besides, I hit a pit. field:Text ,As records added,Sometimes it's a widestring, and later it's a widememo.
IgnoreColumnDataSize of TSqlDBClientDataSet has no effect.becase using create(AOwner: TComponent)...
so,i changed default value of IgnoreColumnDataSize in mormot.db.rad.ui.sql.pas
...
aslite=TSQLModel.Create([
TSQLAuthor...],'root');
arest=TSQLRestServerDB.create(aslite,filename);
TSqlDBClientDataSet.Connection=TSQLDBSQLite3ConnectionProperties.Create(arest.DB);
sql :
SELECT ''All'' as field1, count(*) as field2,' sum(case when ret=0 then 1 else 0 end) as field3
in this case , will got a raise :
raise EVirtualDataSet.CreateUtf8('%.GetFieldData ColumnType=%', [self, TSqlDBFieldTypeToString(ColumnType)]);
(in procedure :InternalInitFieldDefs, mormot.db.rad.ui.sql.pas )
I suggest add :
....
mormot.db.core.ftNull,
mormot.db.core.ftUnknown:
dbtype := ftWideString;
....
I'm building on mormot.net.async.pas's network architecture.
The main changed in mormot.net.async.pas is:The function of checking idle put in a single thread. because you put it to after ProcessWrite(30000) line,when a client is onlie ,Checking idle function will happen per 30 sec.
When a client accepted,will create a connction and fClients.Start(connection) at once.
I founded that error will be occurred when active close a connection
My code is:
procedure TAsyncConnections.IdleEverySecond;
...
fConnectionLock.Lock;
try
for i:=0 to fConnectionCount-1 do
begin
aconn := fConnection[i];
allowed := UnixTimeUtc - aconn.fCanIdleLen;
if aconn.fLastOperation < allowed then
begin
IdleArr.Add(aconn.handle);
...
for i:=0 to High(IntegerArr) do
ConnectionRemove(IntegerArr[i]);
end;Now the following error can occurred(under about 250 wifi's-thermostats connections,ubuntu)
EXCOS EAccessViolation (04) [MQTTSvrTAConnectionspseRead] at 6d8036 ../../SysDataManager/mORMot2/src/net/mormot.net.sock.posix.inc tpollsocketepoll.waitformodified (655) ../../SysDataManager/mORMot2/src/net/mormot.net.sock.pas pollandsearchwithinpending (1513) ../../SysDataManager/mORMot2/src/net/mormot.net.sock.pas tpollsockets.getone (1556) src/MqttServer/mormot.net.async_rw.pas tpollasyncsockets.processread (652) src/MqttServer/mormot.net.async_rw.pas tasyncconnectionsthread.execute (904)
EXC EInvalidCast {Message:"Invalid type cast"} [MQTTSvrTAConnectionspseRead] at 617b04 src/MqttServer/mormot.net.async_rw.pas tasyncconnectionssockets.onclose (816) src/MqttServer/mormot.net.async_rw.pas closeconnection (639) src/MqttServer/mormot.net.async_rw.pas tpollasyncsockets.processread (684) src/MqttServer/mormot.net.async_rw.pas tasyncconnectionsthread.execute (904) No error founded on windows ,when one or two client connected.
I try to do in version 1.18 or 2,the above error will happen aslo.
How to active close a coneection?Please help me or some suggestions.
Please give me some suggestions!
pls see https://github.com/songshuang8/MqttServer, login,sub,unsub ,pub , ping, is ok. no retain!
based on rtsphttp.pas
client is not inerested to me,it's be realized by wifi's chip normal.:)
What I care is the maximum number of connections,
because mqtt is long term connection,I noticed that acceped is served by TSynThreadPoolSubThread. a keeplived connected client is served by THttpServerResp. THttpServerResp is a thread , means a clent is a thread.
I noticed that THttpServerResp is asynchronous wating for received:pending := fServerSock.SockReceivePending(50); ....
I am thinking:
how many threads in a server?
many many client served by a thread pool? how to readlin?
The frame of the network serverd many client is my noticed!
mqtt's protocol is simple to me.
mormot's interface is complex to me ![]()
based frame units:https://github.com/songshuang8/MqttServer,now is nothing but MqttServer.pas
i want to:sqlite is serverd by saving persistent mqtts message, rest is serving manager api,log is loging...
rewrite the unit mormot.net.http or TRestHttpServer?
i am learning the demo :websocket. i try to study the framework of websockt.
please give some suggestions!
Wear a hat,its ok.
use nginx as a shield,It's working ![]()
the mORMot version is trunk. i think SynCommons.pas size is too big? :)
the project is based on sample 30 mvc server. so the static file is published no any "user's" code.
get the static file by the url ,is http://ip/root/static/keysData.rif. i get the file use chrome browser, the progress getting the static file is: 0% go 16%, then turn to 0% repeatly, i think chrome try on get this. After this cycle was repeated a few times,chrome show error.
yes, sending of a static files use nginx is a good idea.
thank you
,
,
i found the problem also, when Ctxt.Returns('....[long size string,got by database record ]...'). client show the err: the content-lenth is more than received.
Other factors is that the network is poor! network bandwidth is 2M only. client is in china and server is in germany. ![]()
Hello,
i has a project in 2019.3; ECrtSocket ("SndLow() error is founded today when client get a static file ,the file is 1.8MB abount.
logs is showing:
20200410 14155759 + admin.TSsAdminServer(7f506ccdab10).URI GET root/static/keysData.rif in=0 B
20200410 14155760 - 00.012.987
20200410 14161760 EXC ECrtSocket ("SndLow() len=1485666 [11 WSATRY_AGAIN Try again]") [TssHTTPSvr 65500/remotedata3 root PoolSub] at 52ea99 52e9cf 534308 53389d 53862f 537ed0 53804d
so i update newest mormot source , but the errer as before.
the environment is buntu 16.04.6 LTS (GNU/Linux 4.4.0-166-generic x86_64)
Number of files received by the client is 16% abount,then error happend.
thanks for help.
others,
the amount of pascal user is A little pitiful!, i m shy to say i m older psacal hands!,but but...
the pascal is wonderful because have mORMOT!
mOrMot is great!.
i see.., thanks very much
delphi7 , lazarus cross.....
if IdemPChar(pointer(Ctxt.URL),'abc') then
.....
but always return false?
same response on windows both linux .
Pages: 1