#1 Re: mORMot 1 » Firebird connectivity using TODBCConnectionProperties » 2014-07-27 10:30:43

sms

I have downloaded Smart Mobile Studio which gives lots of access violations in the ide. So I left  that. Might have a look again .
I am trying out different options for mobile development.

#2 Re: mORMot 1 » Firebird connectivity using TODBCConnectionProperties » 2014-07-27 05:21:47

sms

Yes arnaud . It's working when i turn off firewall . Thanks. I am trying Intel's XDK also now so that I can get rid of FMX

#3 Re: mORMot 1 » Firebird connectivity using TODBCConnectionProperties » 2014-07-26 10:23:27

sms

I have a mac machine with windows parallels (windows 8) installed. I use windows parallels for the development. My server runs inside parallels. I can access the server from the browser in the windows parallels. But If I run it from the mac browser, I am not able to access it. I am new to mac machine. Might need to check the firewall in mac ?

#4 Re: mORMot 1 » Firebird connectivity using TODBCConnectionProperties » 2014-07-26 01:55:56

sms

Hi Arnaud,

I have created a server app using below code which connects to an external FB database.
Bth client and server are developed in XE6 as FMX apps. Server runs perfectly. If the client runs in Windows platform, it runs perfectly. But if I run it in IOS simulator , it doesn't communicate to server. I can't find anything in log file. If I debug it goes TIndyHttpConnectionClass.URI in SynCrossPlatformSpecific.pas and calls POST method . But after that it goes to assembly code. Finally I am getting socket time out error. I have another app which uses direct indy client component to communicate to a delphi server app and it works fine. So indy should work fine in fmx.

I can give teamviewer access if you like to have a look.

Server code

  sConnectionStr := 'DRIVER=Firebird/InterBase(r) driver;UID='+ Settings.DBUser + ';PWD=' + Settings.DBPassword;
  sConnectionStr := sConnectionStr + ';DBNAME=' + Settings.DBAlias ;
  aProps := TODBCConnectionProperties.Create('',sConnectionStr,Settings.DBUser,Settings.DBPassword);
  DataModel := GetDataModel;
VirtualTableExternalRegisterAll(DataModel,aProps);
aRestServerDB := TSQLRestServerDB.Create(DataModel,':memory:',false);
aRestServerDB.CreateMissingTables(0);
aHttpServer := TSQLHttpServer.Create(SERVER_PORT,[aRestServerDB],'+',useHttpApiRegisteringURI);
aHttpServer.AccessControlAllowOrigin := '*';

Client code

  aModel := GetDataModel;
  aClient := TSQLRestClientHTTP.Create('**.***.**.*,StrToInt(SERVER_PORT),aModel);
  memo1.Lines.Add('Add a new TPerson');   
aPerson := TSchooldata.Create;
try
Randomize;
aPerson.ID := 2;
aPerson.Name := 'qeqwe'+ FormatdateTime('ddmmyyyyhhnnss',now);
aPerson.Address1 := 'S 333333';
aID := aClient.Add(aPerson,true);
finally
    aPerson.Free;
end;

#5 Re: mORMot 1 » Firebird connectivity using TODBCConnectionProperties » 2014-07-21 09:02:32

sms

Thank you Antonio and Arnaud. I was getting bad request error when I try from xe6 firemonkey mobile app. The above fix fixed that issue.

Thanks again

#6 Re: mORMot 1 » Firebird connectivity using TODBCConnectionProperties » 2014-07-16 04:03:47

sms

Hi Arnaud , I have downloaded 1.18 version of mormot. But I couldn't find 29 - smartmobilestudio client . I searched for CopySynCrossPlatformUnits.bat which is also missing. I have samples upto 28 - Simple RESTful ORM Server. Can I download the "29 - smartmobilestudio client" alone ?

Thanks

#7 Re: mORMot 1 » Firebird connectivity using TODBCConnectionProperties » 2014-07-14 21:35:10

sms

Thanks Arnaud , I'll check that and come back later

#8 Re: mORMot 1 » Firebird connectivity using TODBCConnectionProperties » 2014-07-10 21:56:12

sms

Hi Arnaud , I try to use SynCrossPlatformREST in one application and it throws lots of errors. First it threw it couldn't find TSHA256. I could find it in Crypto file. But it was declared inside implementation section. I moved out of implementation section which fixed that. Then I got another undeclared identifier crc32ascii . I couldn't find it anywhere in the folder. Am I using an old version or something ?

#9 Re: mORMot 1 » Firebird connectivity using TODBCConnectionProperties » 2014-07-10 12:03:44

sms

Thank you Arnaud.  I will try it in both clients.
I have downloaded the sample code for SMS and will try a simple client app in XE6 tomorrow.

I have seen different samples to create ORM server and interfaced servers. All working fine in XE6 . I have small app in my mind to learn all these technologies.
It's a database app, so I can create a ORM server . So client can call all CRUD functions. But in case if I need to call some general server functions, is that possible in
ORM server ? Or do I need to have 2 separate servers for respective features ?

Thanks,
Sinu

#10 Re: mORMot 1 » Firebird connectivity using TODBCConnectionProperties » 2014-07-10 05:01:32

sms

Hi Arnaub,

I am considering few ways to create a mobile client that can work with mORMot server.

1. Delphi Firemonkey mobile app with indy component
2. Delphi Firemonkey mobile app with TRestClient component
3. Smart Mobile Studio to create HTML 5 app and then use Phone Gap to create mobile app.
4. Rad studio HTML Builder to build HTML 5 app and use Phone gap to create mobile app.

I tried the second option, but couldn't make it work. I got a sample app developed in SMS which I need to go thru in detail. Do you think SMS professional is enough for that ?

What's your opinion on 1st,2nd and 4th options ? I never see anybody talks about HTML Builder here

If I create a mORMot REST Server, will that work perfectly with XE6 and TRESTClient ? Or do I need to create a server with interface to work with that?

#12 Re: mORMot 1 » Firebird connectivity using TODBCConnectionProperties » 2014-07-08 22:39:36

sms

Hi ab, Thanks for directing me to check the log.

Here is the log from client

20140709 10303358  +    TSQLHttpClientWinHTTP(02A45720).TimeStamp
20140709 10303358  +    	TSQLHttpClientWinHTTP(02A45720).00694A61 
20140709 10303362 clnt  		TSQLHttpClientWinHTTP(02A45720) GET root/TimeStamp status=200 state=1
20140709 10303362  -    	00.061.398
20140709 10303362 ret   	135183427489
20140709 10303362  -    00.061.426
20140709 10303362  +    TSQLHttpClientWinHTTP(02A45720).00694A61 
20140709 10303362 clnt  	TSQLHttpClientWinHTTP(02A45720) POST root/Customer status=500 state=2
20140709 10303362  -    00.001.516
20140709 10303362 ERROR TSQLHttpClientWinHTTP(02A45720) POST root/Customer returned 500 Internal Server Error with message  {  "ErrorCode":500,  "ErrorText":"Exception EAccessViolation: Access violation at address 00616283 in module 'License.exe'. Read of address 00000008"  } stack trace API 0061DB2E 0066B310 0066B86E 00666867 0067992D 00695C87 005CBA03 005CB607 005CB5B8 005D6471 0069F8EE 7739919F 777CA8CB 777CA8A1 

And log from server is below

20140709 10330501  +    TSQLRestServerDB(02BE5890).root/Customer
20140709 10330501 SQL   	TSQLRestServerDB(02BE5890) INSERT INTO Customer (FName,MName,SName,Address1,Address2,Suburb,City,State,Country,PostCode,PhoneNo,MobileNo,Fax,Email,WWW,SerialKey) VALUES (:('qeqwe'):,:('M wwww'):,:('S 333333'):,:(''):,:(''):,:(''):,:(''):,:(''):,:(''):,:(''):,:(''):,:(''):,:(''):,:(''):,:(''):,:(''):); prepared with 16 params
20140709 10330501 EXC   	ESQLite3Exception ("no such table: Customer") at 006B8E73  stack trace API 00626970 0040A2F0 
20140709 10330501 ERROR 	TSQLRestServerDB(02BE5890) {"ESQLite3Exception":"no such table: Customer"}{"ESQLite3Exception(02CD8EB8)":[20140709 10330501 EXCOS 	EAccessViolation (C0000005) at 00616283  stack trace API 00626970 0040A2F0 
 stack trace API 00627C5E 006BB19E 006BA454 00693CC6 006908CB 0068F16F 00692793 00733458 005E211D 005E7E65 004C976C 0040AC0E 7739919F 777CA8CB 777CA8A1 
20140709 10330501 srvr  	POST root/Customer ERROR=500 (Exception EAccessViolation: Access violation at address 00616283 in module 'License.exe'. Read of address 00000008)

Looks like it's trying to add the record in sqlite. I want to add it in my FB db. Do I need to setup SQLite even if I use FB for my purpose ?

Thanks
sinu

#13 Re: mORMot 1 » Firebird connectivity using TODBCConnectionProperties » 2014-07-08 09:59:48

sms

I use below statement to create client

    aClient := TSQLHttpClientWinHTTP.Create('localhost',SERVER_PORT,aModel);

Will do a debug and come back

#14 mORMot 1 » Firebird connectivity using TODBCConnectionProperties » 2014-07-08 07:11:08

sms
Replies: 33

Hi AB,

I am using below code to connect to a firebird db. Following code compiles and server runs without any error.

aProps := TODBCConnectionProperties.Create('','DRIVER=Firebird/InterBase(r) driver;UID=SYSDBA;PWD=JOCKEY;DBNAME=C:\Synopse\Samples\Sinu\SINU.fdb;','SYSDBA','JOCKEY');
    aModel := DataModel;
    DataModel := GetDataModel;
    VirtualTableExternalRegisterAll(DataModel,aProps);
    aRestServer := TSQLRestServerDB.Create(DataModel,':memory:',false); // authentication=false
    aHttpServer := TSQLHttpServer.Create(SERVER_PORT,[aRestServer],'+',useHttpApiRegisteringURI);

When I try to add a record in one of the table , Client.Add returns 0. It doesn't add any record in table. But both server and client runs without any error. I try to debug and it fails inside EngineAdd in the below line

if URI(url,'POST',nil,@Head,@SentData).Lo<>HTML_CREATED then

When I debug , my url is root/Customer where Customer is my table name.

But URI(url,'POST',nil,@Head,@SentData).Lo is 501 which is <> HTML_CREATED and exits from the procedure. I can see Head is set to

'HTTP/1.1 400 Bad Request'#$D#$A'Date: Tue, 08 Jul 2014 07:06:25 GMT'#$D#$A'Content-Length: 49'#$D#$A'Content-Type: application/json; charset=UTF-8'#$D#$A'Server: Microsoft-HTTPAPI/2.0'#$D#$A'X-Powered-By: Synopse mORMot 1.18 http://synopse.info'#$D#$A'Server-InternalState: 3'#$D#$A'Accept-Encoding: synlz,deflate'#$D#$A#$D#$A

Am I doing something wrong here ? I took code from 28 - Simple RESTful ORM Server and slightly modified to access FB and my table. That's it.

Any help is much appreciated

Thanks
Sinu

#15 Re: mORMot 1 » SQLite3 DB Verses Firebird » 2014-06-20 19:08:08

sms

Thank you Martin and Arnaud. I am quite impressed by the detailed replies. Thanks a lot for that.

Last 5 years I was working with Firebird. I am quite used to it now. That's why I am bit confused whether I need to change DB engine.

I need 2 databases, one for main POS and another for online licensing. I think for online licensing I can use SQLite3 since it will be quite small db with less data and i can have a small designing without stored procedures.

But for POS I can think of either FB or PostgreSQL. But I never used PostgreSQL. Have to do little bit research on that before I start with it.
With FB, I am quite comfortable.

I can use ORM concept for my Licensing app and use normal way of programming using Delphi for POS.

If I didn't use ORM, I can still use THttpAPIServer just to make a fully independent server, right ? Using the normal Delphi application?

Actually I designed both DBs in firebird already and thought of Delphi XE6 and Datasnap for my server. When I did some research
on the performance of Datasnap I came to know about mORMot :-). So I am completely confused. Let me do some more study and I'll come back with more questions .

Thanks again
sms

#16 mORMot 1 » SQLite3 DB Verses Firebird » 2014-06-20 09:04:20

sms
Replies: 3

Hi ,

I am planning to build a retail POS application from scratch which was using Firebird db. I am going to use mORMot for my server app. The old application was very slow in some ares where the table/query has too many records. Do you think it will be good to move to SQLite3 Db instead of Firebird ? Or SQLite3 is just for small purpose ?

I thought to go with mORMot's ORM once I decide the db :-)

Thanks
sms

#17 Re: mORMot 1 » mORMot with Delphi XE6 REST mobile client » 2014-06-06 09:46:09

sms

Sorry to write before doing some checks. It's working fine when I ran the server as administrator. Thanks.

#18 Re: mORMot 1 » mORMot with Delphi XE6 REST mobile client » 2014-06-06 09:38:24

sms

Hi , I could compile few sample apps. When I ran Server app under :14 - Interface based services", I am getting exceptions and application closes.

how can I attach error screen shot here? Couldn't find any option to attach a file.

#19 Re: mORMot 1 » mORMot with Delphi XE6 REST mobile client » 2014-06-05 09:13:03

sms

Thanks AB.

Now I am trying to compile the sample apps in XE6. But it fails and says Synopse.inc file not found. Control goes to the {$I Synopse.inc} of the project source.
I have this file in the folder and path is added in the project. Any clue ?

Thanks,

#20 Re: mORMot 1 » mORMot with Delphi XE6 REST mobile client » 2014-06-05 04:28:16

sms

I have downloaded 1.18 and tried to compile sample app in Delphi 6. I am getting Internal error :C3890 and goes to SynCommons.

Am I missing something ? Downloaded FastMM4 and added the path. Added Mormot source path too .

#21 Re: mORMot 1 » mORMot with Delphi XE6 REST mobile client » 2014-06-05 00:04:39

sms

Thanks for the very quick reply :-).

I am used to Delphi too much , that's why I am going behind that. I'll check PhoneGap too.

I think I wrongly download 1.17 version from some ink. I'll get latest 1.18 now.

Thanks

#22 mORMot 1 » mORMot with Delphi XE6 REST mobile client » 2014-06-04 23:16:16

sms
Replies: 10

Hi Arnaud,

I was planning to develop a mobile app using Datasnap in XE6 and was searching for the
performance of datasnap before going deep into datasnap.
Came across roberto schneiders tests and heard about mORMot from that site.
I have download framework and all other zip files I found , samples, documentation.
Started reading documentation .
Let me first explain what app I have in my mind.
I was planning to create a datasnap REST server which can talk to my firbird/mysql db
and a website to manage the administration side of this database and a mobile REST datasnap
client which can run in both IOS and andriod. I want to have a scalable server. In future
the users of mobile app can grow . That's why I started thinking about the server performance before
going deep into datasnap.

From many forum pages , I came to know that I can use TSQLHttpAPIServer to create a
RESTful server for me. How can I create a mobile app to communicate to this server
using Delphi XE6 ? Can I simply create a mobile app and using TRESTClient component, can I connect
to mORMot RESTFul server ? Can I use SynCrossPlatformJSON.pas along with XE6's TRESTClient ?

The structure of the project I want is

DB <-> Rest Server <-> Rest mobile client<-> Mobile users
          |
    Web client


Any advice is appreciated :-). I am going to learn more on the framework in the coming days anyway.
Thanks for such a powerful framework.

Kind Regards,
Sinu

Board footer

Powered by FluxBB