Subject | Re: firebird conection pool and glassfish |
---|---|
Author | p.bondar |
Post date | 2013-02-18T19:33:55Z |
> Don't use the class from org.firebirdsql.pool; they are known to beUsed org.firebirdsql.ds.FBConnectionPoolDataSource following error:
> broken, especially when used in combination with an Application server
> connection pool.
>
> The full stacktrace would have helped to pin the problem down with
> org.firebirdsql.ds.FBConnectionPoolDataSource, but with some trying I
> can get that error if I don't specify the serverName property.
>
> At minimum you need to specify the following properties:
>
> serverName (with hostname or IP address)
> databaseName (with path or alias of the database)
> user (Firebird username)
> password (Firebird password)
>
> Instead of the properties serverName, portNumber and databaseName you
> can also use one property:
> database (with <server>[/<port>]:<path-or-alias>, where the
> portnumber is optional)
>
> I would advise not to use the "database" property as it is non-standard
> (JDBC defines the serverName, databaseName and portNumber properties),
> and we might remove it in the future.
>
> Mark
> --
> Mark Rotteveel
javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: GDS Exception. 0. Connection string missing"
With these settings,glassfish-resources.xml:
<? Xml version = "1.0" encoding = "UTF-8"?><! DOCTYPE resources PUBLIC "- / / GlassFish.org / / DTD GlassFish Application Server 3.1 Resource Definitions / / EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd"><resources>Â Â <jdbc-resource enabled="true" jndi-name="jdbc/myDatasource" object-type="user" pool-name="connectionPool">Â Â Â Â <description/>Â Â </ Jdbc-resource>Â Â <Jdbc-connection-pool allow-non-component-callers = "false" associate-with-thread = "false" connection-creation-retry-attempts = "0" connection-creation-retry-interval-in-seconds = " 10 "connection-leak-reclaim =" false "connection-leak-timeout-in-seconds =" 0 "connection-validation-method =" auto-commit "datasource-classname =" org.firebirdsql.ds.FBConnectionPoolDataSource "fail- all-connections = "false" idle-timeout-in-seconds = "300" is-connection-validation-required = "false" is-isolation-level-guaranteed = "true" lazy-connection-association = "false" lazy -connection-enlistment = "false" match-connections = "false" max-connection-usage-count = "0" max-pool-size = "32" max-wait-time-in-millis = "60000" name = "connectionPool" non-transactional-connections = "false" pool-resize-quantity = "2" res-type = "javax.sql.ConnectionPoolDataSource" statement-timeout-in-seconds = "-1" steady-pool-size = "8" validate-atmost-once-period-in-seconds = "0" wrap-jdbc-objects = "false">Â Â Â Â <property name="URL" value="jdbc:firebirdsql:localhost/3150:D:/java/base/DATABSEIFPWAFCAD.fdb"/>Â Â Â Â <property name="User" value="SYSDBA"/>Â Â Â Â <property name="Password" value="masterkey"/>Â Â </ Jdbc-connection-pool></ Resources>
and web.xml:
<? Xml version = "1.0" encoding = "UTF-8"?><Web-app version = "2.5" xmlns = "http://java.sun.com/xml/ns/javaee" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi : schemaLocation = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">Â Â Â Â <session-config>Â Â Â Â Â Â Â Â <session-timeout>Â Â Â Â Â Â Â Â Â Â Â Â 30Â Â Â Â Â Â Â Â </ Session-timeout>Â Â Â Â </ Session-config>Â Â Â Â <welcome-file-list>Â Â Â Â Â Â Â Â <welcome-file> index.jsp </ welcome-file>Â Â Â Â </ Welcome-file-list>Â Â Â Â <resource-ref>Â Â Â Â Â Â Â Â <res-ref-name> jdbc / myDatasource </ res-ref-name>Â Â Â Â Â Â Â Â <res-type> javax.sql.ConnectionPoolDataSource </ res-type>Â Â Â Â Â Â Â Â <res-auth> Container </ res-auth>Â Â Â Â Â Â Â Â <res-sharing-scope> Shareable </ res-sharing-scope>Â Â Â Â </ Resource-ref></ Web-app>
You need to attach the log server glassfish?