Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 20 of 26 total
Thread EDB for Android
Wed, Apr 23 2014 12:04 PMPermanent Link

Adam Brett

Orixa Systems

Uli

Yes.

1. Datasnap Server Application, with EDBQuery as the dataset for the DataSetProvider component. Other Datasnap components also have to be added (a wizard does this)
2. Open a Port on your remote server. The remote server must have an external IP Address.

3. Datasnap Client Application (Android in my case, but any platform is possible) Includes SQLConnection component, you need to change its Param's property so the external IP Address & Port from 2 is in the params. Once active it actually opens a data-channel to 1.
4. Add ClientDataset, link it to the DataSetProvider from 1.

Now you can view the data.

Updates are a bit more complicated Frown

Overall a lot more complicated than just using EDB Components ... but it opens up Mac, iPad, iPhone and Android ... so definitely worth considering!

I have only created the simplest program, but I would be happy to post it here if people were interested.
Wed, Apr 23 2014 12:14 PMPermanent Link

Uli Becker

Adam,

> Now you can view the data.
> Updates are a bit more complicated Frown

Interesting - I'll give it a try when I'll have some time left.

> Overall a lot more complicated than just using EDB Components ... but it opens up Mac, iPad, iPhone and Android ... so definitely worth considering!

Absolutely!

> I have only created the simplest program, but I would be happy to post it here if people were interested.

Please do that. Connecting to EDB databases with Android should be very
important for many developers (at least for me Smiley).

Thanks Uli
Wed, Apr 23 2014 10:59 PMPermanent Link

Peter Evans

On 24/04/2014 2:04 AM, Adam Brett wrote:

Your approach looks promising. I envisage having an ElevateDB database/s
on a website.

>
> 1. Datasnap Server Application, with EDBQuery as the dataset for the DataSetProvider component. Other Datasnap components also have to be added (a wizard does this)

To have a Datasnap Server Application are you using an Enterprise or
above version of Delphi?

(I am looking at the Delphi XE6 Feature Matrix as I write this.)

Or can this be done with a Professional version of Delphi?

So with the ElevateDB component EDBQuery - I assume I would need other
ElevateDB components such as TEDBTable, TEDBDatabase and TEDBSession?


>
> Updates are a bit more complicated Frown
>
> Overall a lot more complicated than just using EDB Components ... but it opens up Mac, iPad, iPhone and Android ... so definitely worth considering!

It would be good if ElevateDB ran on iPhone and Android etc.

I do need to update my ElevateDB database/s on the server. I would be
interested in your approach.


>
> I have only created the simplest program, but I would be happy to post it here if people were interested.
>

Yes, I for one would be interested.

Regards,
  Peter Evans
Thu, Apr 24 2014 10:55 AMPermanent Link

Adam Brett

Orixa Systems

Uli & Peter,

You have to build 2 applications, a Server (run on your remote Windows Server) and the Client (can be built for any platform, Windows, Android, iPad).

I am working with Delphi XE5 Enterprise. You need Enterprise to have the DataSnap Server components.

Delphi Professional does not have Datasnap or even the Android components (they can be bought as an extra). So Enterprise is essential for developing the Server. The Client can be developed with Professional + Mobile Pack ... but that would really be pointless without the Server.

--

DataSnap works in a funny way, so as to be flexible. It can create JSON data-packets and other communication protocols as well as ClientDataSet, so there are several quite disconnected components which are used differently depending on the application. When you first see this it really doesn't make much sense. You just have to trust that all the components will work together as there are no visible links between anything in the project.

A serious issue is that DataSnap uses Reflection and RTTI, so many of the objects must be Published (not public or private) this confounded me for a while as there is no easy way to debug failure of links to be created onto non-Published objects. It also likes to have TDataModules used to hold the DataSetProviders, which is all RAD ... something I actively dislike, but seems to be hard to work against.

Datasnap has not been developed in a style which I like (I prefer obvious connections between linked objects) but I can see it has been done like this for flexibility and reuse.

There is a wizard which links all the components together for you. The wizard creates a MainForm which is not actually linked to any part of the DataSnap portion of the project (!!!) so it is actually quite hard to figure out how any of it works.

I have slightly adapted the Wizard-generated code to make it very slightly more understandable (to me). In my MainForm the Data-Snap components are created in the form's OnCreate, and I have created an Ancestor datamodule (which fulfills the RAD requirement of DataSnap) from which I can descend my Own "ServerContainer" classes which can be instantiated by the programme.

I attach 2 projects. "DSServer" and "MobileClient" in ZIP format.

You will need Delphi Enterprise to open the Server.
You will need Delphi XE5 Pro (with mobile) or Enterprise to open the Client.

Earlier versions might work ... but I have used LiveBindings and other modern features which will definitely not work in most older versions Frown

--

IMPORTANT EDB Issues:

Every user opening a Client Application creates a new "session" on the Datasnap server. At first I used a hard-coded name for my EDBSession. This resulted in an error "Session XXX already exists".

Switching to "AutosessionName" on the EDBSession fixes this.



Attachments: Client.zip
Thu, Apr 24 2014 10:56 AMPermanent Link

Adam Brett

Orixa Systems

Peter & Uli

Server ... NG will only take 1 attachment per message on web.



Attachments: Server.zip
Thu, Apr 24 2014 11:55 AMPermanent Link

Uli Becker

Adam,
> You have to build 2 applications, a Server (run on your remote Windows Server) and the Client (can be built for any platform, Windows, Android, iPad).

Thanks a lot for sharing this!

Regards Uli
Sat, Apr 26 2014 1:48 PMPermanent Link

Walter Matte

Tactical Business Corporation

Thanks Adam ... its not something I am thinking about right now but look forward to leaning.

Walter
Sun, Apr 27 2014 7:00 PMPermanent Link

Peter Evans

On 25/04/2014 12:55 AM, Adam Brett wrote:


> A serious issue is that DataSnap uses Reflection and RTTI, so many of the objects must be Published (not public or private) this confounded me for a while as there is no easy way to debug failure of links to be created onto non-Published objects. It also likes to have TDataModules used to hold the DataSetProviders, which is all RAD ... something I actively dislike, but seems to be hard to work against.
>
> Datasnap has not been developed in a style which I like (I prefer obvious connections between linked objects) but I can see it has been done like this for flexibility and reuse.
>

I have been looking into DataSnap after you mentioned it.

Over the years there have been interesting discussions about the
performance of DataSnap.

The following
http://robertocschneiders.wordpress.com/2013/01/09/datasnap-analysis-based-on-speed-stability-tests-part-2
 link is a discussion starting in January 2013. It seemed to end with
talk about Delphi XE3. I note that the discussion has restarted a few
days back now that Delphi XE6 has been released.

In two days time I will be seeing the Delphi XE6 product presentation by
Marco Cantu. I will see what statement is made about DataSnap. This is
important because the just released Webinar, which runs for about 2
hours 10 minutes, overlooked the slide bullet point on DataSnap.

Regards,
  Peter Evans



Mon, Apr 28 2014 4:03 AMPermanent Link

Adam Brett

Orixa Systems

Peter Evans wrote:

>>I have been looking into DataSnap after you mentioned it.

>>Over the years there have been interesting discussions about the
>>performance of DataSnap.

Yes, I have watched these a bit from the side-lines.

I have been honestly surprised how fast my DataSnap server returns data to my Android App. However this is an amateur test to a single device.

My impression is that it is actually fast. However I am not sure how well it would scale on the server. i.e. multiple concurrent users might overwhelm it.

This is not a problem for me ... I might have 30 - 50 users hitting the server, and they would not even all be on-line at the same time.

>>Marco Cantu Webinar

I would be really interested if you get an opportunity to ask questions about DataSnap.

EVERY Borland / CodeGear / Embarcadero Datasnap training is the same: Use the Wizard, set up a single query on the server & fetch data to it.

If you do this is works, but such a trivial example is not useful for the real world. Once you "dig in" to the way DataSnap really works (a lot of RTTI and reflection) it is very non-transparent. I think it is hugely powerful. Some more detailed sessions on how the architecture is actually put together would be really useful.

Adam
Mon, Apr 28 2014 4:13 AMPermanent Link

Adam Brett

Orixa Systems

Peter

>>http://robertocschneiders.wordpress.com/2013/01/09/datasnap-analysis-based-on-speed-stability-tests-part-2

Thanks for the references to this. I read both parts.

I think the key fact is buried in the blog: DataSnap uses INDY.

I wrote a webserver using INDY (and DBISAM) about 10 years ago. It was actually really good technology. However, it does not scale particularly well without careful handling.

As the Blog-writer says, each Session (i.e. new user connecting) spawns a new instance of the program on the server and generates a new thread on the processor.

This is intensive. No 1 machine can respond to 100,000's of requests.

It is possible to work around this. (I understand, actually I have never done this).

However, if your use-case does not involve vast numbers (as is my case) of users this does not need to be a problem.

I think for most EDB coders this is probably the case.
« Previous PagePage 2 of 3Next Page »
Jump to Page:  1 2 3
Image