Do I need to release and initilize the Data Source builder manually?
I have an application which every morning is giving me sale connection errors
or connection reset errors with oracle the first time that I enter it.
After that the application runs pretty much smoothly.
Now I see that portlet factory has the following methods for data sources:
Now I always thought that the connections were managed automatically, but
would any of these methods help me with my connection problems?
Pinned topic Do I need to release and initilize the Data Source builder manually?
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2010-02-16T16:27:38Z at 2010-02-16T16:27:38Z by SystemAdmin
kevintap 100000QN0341 Posts
Re: Do I need to release and initilize the Data Source builder manually?2010-02-13T03:50:22ZThis is the accepted answer. This is the accepted answer.The best way that I've found to deal with stale connection issues as you describe is to let the App Server handle it for you.
The WAS admin console varies a bit by version, but in the Data Source properties for each data source, there is a option to pre-test connections. This configures the App Server to execute a SQL statement against the data source (usually something like SELECT 1 FROM SYSIBM.SYSDUMMY1) prior to it handing that connection to the application. This virtually ensures that the application (portlet) will always have a good, tested connection to the data source. (I say virtually here, since there is no real guarantee that the connection won't go bad between the App Server's test and when the application gets the connection, but this is a very small window.)
Re: Do I need to release and initilize the Data Source builder manually?2010-02-13T05:23:01ZThis is the accepted answer. This is the accepted answer.
- kevintap 100000QN03
Its funny I had also though about performing some trivial query
to make sure that the connections were fine. But I'll be sure to
look into enabling the pre test on the data sources.
So I guess that I wasn't totally wrong in regards to the WPF
all the connection stuff is handled for me.
DGawron 10000054HC251 Posts
Re: Do I need to release and initilize the Data Source builder manually?2010-02-16T16:00:47ZThis is the accepted answer. This is the accepted answer.
- kevintap 100000QN03
As an aside, you should always implement error handling for any back-end access. These automted techniques (the one Kevin suggested and the one described above) can only take you so far. Your app still needs to be written to handle exceptional cases such as the DB not even being available.
Re: Do I need to release and initilize the Data Source builder manually?2010-02-16T16:27:38ZThis is the accepted answer. This is the accepted answer.
- DGawron 10000054HC
And thanks I'll look into the timeout issue.