Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Establishing database connection in RCP
Establishing database connection in RCP [message #414229] Thu, 10 March 2005 00:30 Go to next message
Eclipse UserFriend
Hi all,

My app needs to connect to database and keep the connection throghout the
entire apps, where's is most appropriate event to put code to connect to
database ?

Thanks in advance


Setya
Re: Establishing database connection in RCP [message #414906 is a reply to message #414229] Fri, 11 March 2005 21:32 Go to previous messageGo to next message
Eclipse UserFriend
The singleton approach is probably the easiest one to implement.
You initialize the connection on first access.
However if you are accessing the connection on the critical path of
opening the workbench (ie in the application, or in the advisors) you
may slow down the startup if connecting to the db is slow.

PaScaL

Setya wrote:
> Hi all,
>
> My app needs to connect to database and keep the connection throghout
> the entire apps, where's is most appropriate event to put code to
> connect to database ?
>
> Thanks in advance
>
>
> Setya
>
Re: Establishing database connection in RCP [message #414931 is a reply to message #414906] Sun, 13 March 2005 22:47 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the response,

> The singleton approach is probably the easiest one to implement.
> You initialize the connection on first access.
> However if you are accessing the connection on the critical path of
> opening the workbench (ie in the application, or in the advisors) you
> may slow down the startup if connecting to the db is slow.

Yes, I'm aware of the effect if the db connection is slow. So basically I
can put the database connection establishing code in application.run
method ?

> PaScaL

Thanks.


Setya
Re: Establishing database connection in RCP [message #416816 is a reply to message #414931] Sun, 20 March 2005 03:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: shashireo.hotmail.com

Setya wrote:
> Thanks for the response,
>
>> The singleton approach is probably the easiest one to implement.
>> You initialize the connection on first access.
>> However if you are accessing the connection on the critical path of
>> opening the workbench (ie in the application, or in the advisors) you
>> may slow down the startup if connecting to the db is slow.
>
>
> Yes, I'm aware of the effect if the db connection is slow. So basically
> I can put the database connection establishing code in application.run
> method ?

I think you can make the application responsive enough by starting a
background job for the database connection.
http://www.eclipse.org/articles/Article-Concurrency/jobs-api .html

Shashi

>
>> PaScaL
>
>
> Thanks.
>
>
> Setya
>
>
Re: Establishing database connection in RCP [message #416818 is a reply to message #416816] Sun, 20 March 2005 05:22 Go to previous message
Eclipse UserFriend
Shashi wrote:

> Setya wrote:
>> Thanks for the response,
>>
>>> The singleton approach is probably the easiest one to implement.
>>> You initialize the connection on first access.
>>> However if you are accessing the connection on the critical path of
>>> opening the workbench (ie in the application, or in the advisors) you
>>> may slow down the startup if connecting to the db is slow.
>>
>>
>> Yes, I'm aware of the effect if the db connection is slow. So basically
>> I can put the database connection establishing code in application.run
>> method ?

> I think you can make the application responsive enough by starting a
> background job for the database connection.
> http://www.eclipse.org/articles/Article-Concurrency/jobs-api .html

> Shashi

>>
>>> PaScaL
>>
>>
>> Thanks.
>>
>>
>> Setya
>>
>>

Great article, thank you very much Sashi.

Regards,

Setya
Previous Topic:setSaveAndRestore(true) does not work on IFolderLayout ?
Next Topic:Keybindings
Goto Forum:
  


Current Time: Sat Nov 08 14:03:04 EST 2025

Powered by FUDForum. Page generated in 0.25738 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top