Subject Re: FBConnectionPoolDataSource problems
Author mapofe
Roman, thank you!
I didn't set the user properties and the loop is actually not infinite.
The db character encoding is ISO8859_1.
Regards
Massimo

--- In Firebird-Java@yahoogroups.com, "Roman Rokytskyy"
<rrokytskyy@a...> wrote:
> > FBConnectionPoolDataSource xaDatasource = new
> > FBConnectionPoolDataSource();
> > xaDatasource.setType(GDSType.getType("PURE_JAVA").toString());
>
> You can simply use
>
> xaDatasource.setType("PURE_JAVA");
>
> xaDatasource.setDatabase("localhost/3050:D:/Projects/test/test.fdb");
> > xaDatasource.setMinConnections(0);
> > xaDatasource.setMaxConnections(2);
> > xaDatasource.setPingInterval(5000);
> > Properties p = new Properties();
> > p.setProperty(FBDriver.USER, "sysdba");
> > p.setProperty(FBDriver.PASSWORD, "masterkey");
> > p.setProperty("charSet", "ISO8859_1");
>
> Where is following code?
>
> xaDatasource.setProperties(p);
>
> > but as soon as I try to get a connection
> > xaDatasource.getXAConnection();
> > the driver does not return anymore. Looking at the code I noticed that
> > in PooledConnectionQueue.take() the driver wasn't able to get a
> > connection because userName and password failed, although correctly
> > initialized, and entered an infinite loop.
>
> Inifine loop or a very long loop? Try to set blocking timeout (default
> value is Integer.MAX_VALUE).
>
> > FBConnectionPoolDataSource.getPooledConnection() actually is
> > hardcoded to use EMPTY_USER_PASSWORD instead of the previously
> > provider credentials.
>
> that's not empty user name and password, but a constant saying that no
> user and password were supplied in the method call. This object is
> used to find the appropriate conection queue in the map, that it turn
> uses credentials supplied to the data source.
>
> > Getting a connection as follows works:
> > xaDatasource.getXAConnection("masterkey", "sysdba");
>
> ... but your character encoding for the connection is NONE, not
> ISO8859_1, right?
>
> Roman