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 137837 - weak naming strategy causes overwrites
Summary: weak naming strategy causes overwrites
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 6.x
Hardware: PC Solaris
: P2 blocker (vote)
Assignee: Nitya Doraisamy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-20 18:56 UTC by Vince Kraemer
Modified: 2008-08-21 06:05 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vince Kraemer 2008-06-20 18:56:22 UTC
It looks like a the strategy for naming a connection pool (and other resources???) in ResourceConfigurator.java may make
it easy to end up overwriting data that should not be shared between deployed applications.

See: http://javacollassato.wordpress.com/2008/06/15/multiple-enterprise-application-and-jpa-does-not-work-in-netbeans-61/
Comment 1 mgcm 2008-07-04 16:57:13 UTC
I believe this is a non-issue.

To solve the problem described in the URL, just be sure to to change your “sun-resources.xml” file under “Server
Resources” in NetBeans the following way:

<jdbc-resource enabled=”true” jndi-name=”MY_JNDI_NAME” object-type=”user” pool-name=”MY_POOL_NAME”/>
<jdbc-connection-pool … name=”MY_POOL_NAME” … >
…

This way, Glassfish will automatically create your JDBC pool upon deployment.
Comment 2 Vince Kraemer 2008-07-04 17:48:48 UTC
Actually, it is a bug in our code.  The fact that you can work-around it is what makes it a p3 bug, not a p1 or p2 bug.

The plugin wrote the initial data that triggered the issue.... and it was pretty easy to identify what was "wrong"...
Comment 3 Vince Kraemer 2008-07-26 00:37:09 UTC
please fix this for 6.5.
Comment 4 Vince Kraemer 2008-07-26 20:31:21 UTC
would embedding the jndi name of the jdbc resource that this pool is being created to be associated with solve the issue?

It looks like it will.

See ResourceConfigurator.java in the method createDataSource....
Comment 5 Nitya Doraisamy 2008-07-31 21:12:47 UTC
Embedding the jdbc resource name  would work but will result in multiple connection pools for the same db.
The plugin creates a poolname using the database vendor name(eg.derby_net) and the checks to make sure that a similar
pool is not present in the project. But a second project using Derby for a JDBC resource will result in the same
connection pool name (derby_net).

A good strategy would be to use a longer name say, dbvendor+dbname+user. I think this would cover 95+% of the cases

Comment 6 Quality Engineering 2008-08-01 04:12:32 UTC
Integrated into 'main-golden', available in build *200808010201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/9b3d40ea3d0a
User: nityad@netbeans.org
Log: #137837 : Fix for weak naming strategy in creating connection pools
pool names now use  vendor + dbname + user
add dependency on glassfish.eecommon from appsrv to for v2 plugin to reuse url parsing logic
Comment 7 Nitya Doraisamy 2008-08-01 06:21:26 UTC
Plugin now uses vendor_dbname_user_Pool to generate unique name for connection pools
Comment 8 Quality Engineering 2008-08-21 06:05:56 UTC
Integrated into 'main-golden', available in build *200808210201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/46789c081002
User: nityad@netbeans.org
Log: #137837 : Fix for weak naming strategy in creating connection pools pool names now use  vendor + dbname + user