Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369243 - Allow user to enable JNDI connection pooling on test server
Summary: Allow user to enable JNDI connection pooling on test server
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Justin Spadea CLA
QA Contact:
URL:
Whiteboard: jndi
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-20 10:02 EST by Justin Spadea CLA
Modified: 2017-02-23 14:15 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Spadea CLA 2012-01-20 10:02:37 EST
Every data source implementation is different and requires different parameters. Some will have a "user" parameter, others will call it "username"; some will let you set the JDBC URL, others force you to specify the individual pieces (which differ from class to class). The only way would could support any data source class would be to have the user tell us every property name and its value, in a table. Rather than force them to do a lot of work, the test server has the following support (already implemented):

1. If org.apache.tomcat.dbcp.dbcp.BasicDataSource is present, we'll use it. This class supports connection pooling and is very fast on subsequent connections.

2. The fallback is our own very, very simple implementation called SimpleDataSource. It has no connection pooling, just invokes DriverManager.getConnection() under the covers. We can add connection pooling in the future, but for now it just "gets the job done" so that JNDI can be used by the test server.

This work item is to provide some indication to the user about BasicDataSource. The test server should be updated to check for a Tomcat runtime and add it to its classpath if it finds it. This way all the user needs to do is define the Tomcat runtime and they have connection pooling. We can make the test server's preference page indicate whether connection pooling is available, and if it's not we can provide a button that pops up the New Runtime wizard, preferably with everything except tomcat filtered out. We can also have the test server write a warning to the console if connection pooling is not available.

Since what we already have "works", this is not a must-have for 0.8, but we should try to fit it in. At the very least we could write a blog post about how to enable it (right now you must add the Tomcat runtime to the project running the test server).
Comment 1 Brian Svihovec CLA 2012-01-31 15:18:57 EST
Justin, If the test server has access to a console window, would it be enough to print a message to the console when connection pooling was not being used?  Something like:

<RED> Connection pooling is not supported with the current configuration.  Add <tomcat jar file name> to the classpath of project <project name> to enable connection pooling.</RED>
Comment 2 Justin Spadea CLA 2012-01-31 16:29:48 EST
That could be a good low-cost solution for now. Regardless of indicating in the UI somehow, this would be good to add. Sort of how like Tomcat prints a warning when some certain native library is not installed that improves performance.
Comment 3 Justin Spadea CLA 2012-02-01 13:20:53 EST
A warning message is now printed in the console. Is there anything else we want to do for this?
Comment 4 Justin Spadea CLA 2012-02-20 09:16:50 EST
Closing. We can improve this more in the future if we feel it's not obvious enough.
Comment 5 Justin Spadea CLA 2012-02-22 08:53:27 EST
Closing