Search code examples
jakarta-eenetbeansglassfishconnection-pooling

NetBeans automatically changes connection pool settings


I'm developing web application with glassfish and netbeans 6.9.1. I have generated persistence unit, entities and jpa controller classes from database in netbeans. Connection Pool to my database was automatically generated by netbeans (I've chosen "New Datasource..." in New Entity Classes from Database dialog). Now I have to tune some settings in connection pool to get it work with my app and, during redeploy, netbeans is changing those settings to those made while creation. When I change connection pool in jndi, it is being set to default also. When I redeploy my app via Glassfish Admin Console, everything remains unchanged. It is quite annoying to deploy application each time manually. Could You please tell me if there is some way to prevent netbeans from changing connection pool settings?

Thanks in advance, Piotrek


Solution

  • To have NB stop updating the connection pool settings during redeployment do the following:

    1. Find the sub-node of your project named 'Server Resources' and expand it.

    2. Delete the file named sun-resources.xml.

    If you edit the file, you can force NB to update the settings to match the values that you have tuned with the admin console.

    This may be a better choice, since this allows you to share these settings with other developers and benefit from the automatic resource creation feature of deployment if you start to deploy your app onto a different server.