I'm using JasperReports Server 4.7 with PostgreSQL 9.1 backend. Trying to set the data source timeout setting but cannot find it in the datasource configuration page. Anyone know where I can set this? I've also searched all the configuration xml files as well.
I don't think you can do it with a JDBC data source (though I'm not certain). But you can certainly set a timeout or a keepalive parameter on a JNDI datasource. Use that instead, and you should be all set.
You can indeed specify a connection timeout in the jdbc url.
example: jdbc://server/database?connectTimeout=<TIMEOUT IN MILLISECONDS>
Check more properties here: http://dev.mysql.com/doc/connector-j/en/connector-j-reference-configuration-properties.html
Related
I am using keycloak-adapter-core in version 9.0.2 and need to set a timeout for a HTTP connection between application and Keycloak server. Unfortunately, I do not see this option in the library:
https://www.keycloak.org/docs/latest/securing_apps/#_java_adapter_config
e.g. connection-pool-size.
I recheck also code library and I do not see that timeout is set up.
Do you know any workaround for this ?
You need to use
socket-timeout-millis
in your config. See here for reference
In the PostgreSQL documentation https://www.postgresql.org/docs/10/libpq-connect.html, it has been said that multiple hosts can be specified in a single connection string such that all the hosts will be tried in order one after the other until one of the server gets succeeds.
But when i tried to implement the same setting in the tag present in my ASP.net web.config file, it is throwing error as no such host name. I am using NpgSQL provider in order to connect to PostgreSQL database.
I need to add multiple server names in the connection string such that if the server#1 fails then it should try for the next server server#2 immediately provided in the order until it succeeds
Can you please suggest on how multiple hosts can be provided in the connection string?
The Npgsql driver does not currently support this functionality. The issue tracking this is https://github.com/npgsql/npgsql/issues/732, I'm still hoping we can get this into the next release but there's a lot going on.
Load balancing and failover is avaialble in Npgsql version 6. At the time of writing v.6 is in preview.
Simple failover example (server2 is only used if a connection could not be established to server1):
Host=server1,server2;Username=test;Password=test
Example with load balancing (round robin I guess):
Host=server1,server2,server3,server4,server5;Username=test;Password=test;Load
Balance Hosts=true;Target Session Attributes=prefer-standby
https://www.npgsql.org/doc/failover-and-load-balancing.html
I am starting to use FlexyPool to monitor an JNDI datasource managed by Tomcat.
I found how to monitor one datasource in this answer and in FlexyPool doc. I can not, however, figure how to configure the monitoring of multiple sources through the flexy-pool.properties file. Is this possible ?
Currently, the declarative configuration only supports a single DataSource. You can open an issue on GitHub for this. I would not mind if you send a Pull request for it.
I have an application written with spring-boot (i am new to it so please forgive me if question is dumb) that uses hibernate 4 and postgresql as DB backend.
I noticed a bunch of connections on the DB that belong to the connection pool stating: "SET extra_float_digits = 3"
Googling around, I've found that it is probably due to the use of the old protocol and that could be avoided using the assumeMinServerVersion parameter of the jdbc driver.
Now my question is: how do i pass / set that parameter from a spring-boot application?
According to this page you could set a assumeMinServerVersion parameter in the jdbc url, something like
spring.datasource.url=jdbc:postgresql://localhost/test?assumeMinServerVersion=XYZ
I am trying to create a jdbc connection to a postgresql database. I would like to use a datasource. In the documentation of postgresql is stated that one should not use their own implementations of the datasource, but use the implementations of org.apache.commons.dbcp instead. The SharedPoolDatasource looks perfect to me.
The jdbc driver must be postgresql. Glassfish v3.1 offers the opportunity to create a jdbc connection pool. I would like to use that one, but do not know how to make the connection between the commons datasource implementation and the jdbc driver. When I fill in the document on the glassfish server that particular field blanks out forcing me to use the postgresql datasource implementation.
Is this impossible to achieve or do I have to enter data manually in config files? So far I did not have any luck nor feedback. Exceptions should appear in the server.log, but the server.log currently does not show anything (it did show exceptions deploying jsf and ejb applications).
Should be possible....
1. Create a new JDBC Connection Pool:
2. Choose your desired Datasource Implementation Class:
You'll have to setup the details for databasename, user and password in the additional properties tab.
3. Create a new JDBC Resource: