Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Multithread access to Elevate
Tue, Jun 19 2018 5:28 AMPermanent Link

Adam Brett

Orixa Systems

Are there any examples of how to create multi-thread applications with Elevate?

I have a working system, but I would like to add a new thread to do some lengthy DB operations (backup etc.) and not "hang" the main program.

Is it sufficient to just create a new Query or Stored Procedure component in a new thread and connect it to the main database / session components in my application?

Or do I need more isolation than this, should I create wholly new database / session objects?

I am trying the later way at the moment, creating new database and session objects, but am getting an error
"Cannot perform this operation when the engine has been started."
Tue, Jun 19 2018 5:30 AMPermanent Link

Adam Brett

Orixa Systems

OK Sorry, I should have looked at this before writing:

https://www.elevatesoft.com/manual?action=viewtopic&id=edb2&product=delphi&version=7&topic=multi_threaded_applications

... but if any other readers have comments I would be grateful.
Tue, Jun 19 2018 5:57 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam


As you've discovered you need total isolation. However, in a c/s environment this means that you can run out of sessions. Think the free server that ships with ElevateDB it comes with a 5 session limit.

In one application I was creating session, database, table for each unit since various chucks could be used in different places (eg Bayesian testing) and this worked fine in f/s but overran the session limits in the free server very quickly. What I started doing was passing the necessary objects through to subordinate units. Each thread got its own but bits and pieces they used didn't. Not only did this reduce the sessions but it improved performance a bit - not much but a bit.

Roy Lambert
Fri, Jun 22 2018 1:02 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Adam,

<< Are there any examples of how to create multi-thread applications with Elevate? >>

You already found this, but in case of Google:

https://www.elevatesoft.com/manual?action=viewtopic&id=edb2&product=rsdelphiwin32&version=10T&topic=Multi_Threaded_Applications

<< Is it sufficient to just create a new Query or Stored Procedure component in a new thread and connect it to
the main database / session components in my application? >>

<< I am trying the later way at the moment, creating new database and session objects, but am getting an error
"Cannot perform this operation when the engine has been started." >>

That indicates that you're trying to do something with the TEDBEngine component, not the TEDBSession or TEDBDatabase components.

Tim Young
Elevate Software
www.elevatesoft.com
Image