This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 98309 - Connection pools not for all DB are created
Summary: Connection pools not for all DB are created
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Nitya Doraisamy
URL:
Keywords:
: 94096 (view as bug list)
Depends on:
Blocks: 111037
  Show dependency tree
 
Reported: 2007-03-20 11:52 UTC by Roman Mostyka
Modified: 2007-08-06 21:20 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Application (5.99 MB, application/octet-stream)
2007-03-23 16:59 UTC, Roman Mostyka
Details
sun-resources for MySQL (1.52 KB, text/xml)
2007-07-21 07:12 UTC, John Baker
Details
generated sun-resources for multiple databases (4.06 KB, text/xml)
2007-07-21 07:13 UTC, John Baker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2007-03-20 11:52:28 UTC
1. Create Visual Web Application.
2. Add 4 new pages. Now it is 5 pages in application.
3. Add one 'Table' component to the each page.
4. Bind table from first page with table from Derby.
5. Bind table from second page with table from MySQL.
6. Bind table from third page with table from Oracle.
7. Bind table from fourth page with table from PointBase.
8. Bind table from fifth page with table from MS SQLServer.

Note: Tables in DB must be from similar schemas.

9. Deploy application to GlassFish.

Result: Connection pools only for Derby, MS SQLServer and PointBase are created.
The rest of data sources are connected to PointBase's connection pool. But
everything works fine.
Comment 1 Nitya Doraisamy 2007-03-22 22:50:21 UTC
This is a combination of both Visual Web pack / IDE /Server plugin
While I am aware of how the IDE interacts with the plugin, I have no idea of VWP
related flow. 

I need info on the API's being called by VWP when a table is bound to a db.
What are the calls being made, what is the input etc. Any documents from VWP on
how these things are implemented.

Also, where can I get the binary for VWP for NB 5.5.1, step by step instructions
on how to create this app and bindings to db
Need more info.
Comment 2 Roman Mostyka 2007-03-23 07:35:41 UTC
1) Step by step instructions on how to create this app 
You can find instructions in description.

2) Bindings to db
Just expand DB, click on table from DB and then click on 'Table' component.

About other information You should probably ask John Baker.
Comment 3 John Baker 2007-03-23 09:00:22 UTC
I think this is a duplicate of this task 90264
Comment 4 Roman Mostyka 2007-03-23 09:11:37 UTC
Not exactly. If I will deploy application with one page and table on it, which
is bound to one DB, connection pool will be created. For every DB. But if deploy
application with databinding with many DBs, connection pools not for all Dbs are
created, for some other DB's connection pools are used.
Comment 5 Nitya Doraisamy 2007-03-23 16:32:15 UTC
Please attach the project.

John, at what point are calls made by VWP to create the required datasources.
What is the api being called. Again, any pointers to VWP docs covering api's/
usecases. I don't want to spend time on tutorials on VWP features to figure out
what happens and when.
Comment 6 Roman Mostyka 2007-03-23 16:59:39 UTC
Created attachment 39882 [details]
Application
Comment 7 Vince Kraemer 2007-06-07 00:01:49 UTC
The attached app doesn't have a CP definition for Oracle or MySQL.

Are there any messages in the IDE's log file that might give us a clue about
this....

Either the plugin code failed to create the CP definitions OR the plugin did not
get called to create the CP's...

Since you say that you can create 5 apps that access each of the DBs (see
desc5), I think there may be a bug in VWP, which prevents the CP definition
creation from happening.

Have you verified that the plugin is getting called and failing?
Comment 8 John Baker 2007-06-07 00:22:29 UTC
in 5.5.x, visualweb will not add connection pools if they exist on the server.

To workaround this, the pools can be added manually through New->File/Folder

Hope to resolve this in 6.0
Comment 9 _ jimdavidson 2007-07-19 20:55:40 UTC
John, could you take a look at this?

It's probably not worth trying in 5.5.1, since we're mainly concerned about 6.0.  Not clear whether the problem lies on
the datasource end, or in the server plugins.
Comment 10 John Baker 2007-07-21 07:07:49 UTC
I created a new application and added rowsets for Oracle, MySQL, MSSQL Server, Derby by dragging and dropping unique
database tables from each of these databases.

As a result, connection pools for all databases were generated in sun-resources.xml , except for MySQL

Then, I created a 2nd application with only a rowset from MySQL.
As a result a connection pool was successfully created for MySQL

Attached are sun-resources.xml from each project
Comment 11 John Baker 2007-07-21 07:10:59 UTC
I created a new application and added rowsets for Oracle, MySQL, MSSQL Server, Derby by dragging and dropping unique
database tables from each of these databases.

As a result, connection pools for all databases were generated in sun-resources.xml , except for MySQL

Then, I created a 2nd application with only a rowset from MySQL.
As a result a connection pool was successfully created for MySQL

Attached are sun-resources.xml from each project
Comment 12 John Baker 2007-07-21 07:12:28 UTC
Created attachment 45480 [details]
sun-resources for MySQL
Comment 13 John Baker 2007-07-21 07:13:48 UTC
Created attachment 45481 [details]
generated sun-resources for multiple databases
Comment 14 John Baker 2007-07-21 07:25:05 UTC
visualweb update data sources using

updateProjectDataSource(Project project, RequestedJdbcResource req) in 
org.netbeans.modules.visualweb.project.jsf.services.DesignTimeDataSourceServiceImpl.java


     J2eeModuleProvider jmp =
                (J2eeModuleProvider)project.getLookup().lookup(J2eeModuleProvider.class);

     jmp.getConfigSupport().createDatasource(req.getResourceName(), req.getUrl(),
                        req.getUsername(), req.getPassword(), req.getDriverClassName());


Logic is the same for all databases.

It's odd that a connection pool can be created for MySQL if it's the only database.
Note, no MySQL connection pool had been created in the server.

jmp.getConfigSupport().createDatasource(...) will create a data source regardless whether it had been created on the server

Note, all projects created with Glassfish as the target server.

 
Comment 15 John Baker 2007-07-21 07:26:55 UTC
This seems to be a serverplugin issue.
visualweb has no limitation for creating multiple data sources from multiple databases
Comment 16 Nitya Doraisamy 2007-08-03 08:37:27 UTC
I have made some fixes to the resource creation code in the plugin.
I am not able to reproduce this issue. 
John, Could you test it and check whether this issue is still present?
Comment 17 Roman Mostyka 2007-08-03 17:43:56 UTC
Verified with build 070803.
Comment 18 Roman Mostyka 2007-08-03 17:45:51 UTC
Verified with build 070803.
Comment 19 Nitya Doraisamy 2007-08-06 21:20:22 UTC
*** Issue 94096 has been marked as a duplicate of this issue. ***