camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Camel Guy (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CAMEL-7904) JDBC component: Setting the PostgreSQL schema search path
Date Wed, 19 Nov 2014 16:52:34 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-7904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14218116#comment-14218116
] 

Camel Guy edited comment on CAMEL-7904 at 11/19/14 4:51 PM:
------------------------------------------------------------

The main problem is that PostgreSQL doesn't let you specify the schema on the connection properties.

Please see:

http://postgresql.nabble.com/Search-path-in-connection-string-td5718440.html

The beta 9.4 driver will not add this feature. Therefore, I think using Postgres with a connection
pool is just a headache, especially since my app determines the database name, schema, etc.
at run time. I use recipientList and dynamically generate the "to" jdbc: url. 

I guess for now, I'd better turn off connection pooling.


was (Author: camelguy):
The main problem is that PostgreSQL doesn't let you specify the schema on the connection properties.

Please see:

http://postgresql.nabble.com/Search-path-in-connection-string-td5718440.html

The beta 9.4 driver will not add this feature. Therefore, I think using Postgres with a connection
pool is just a headache, especially since my app determines the database name, schema, etc.
at run time. I use recipientList and dynamically generate the "to" jdbc: url. 

I need to be able to run a command on the connection (set search path) and then run another
SQL statement, guaranteeing that I am using the same connection for both statements despite
the fact that under the covers a connection pool is being used. I guess for now, I'd better
turn off connection pooling.

> JDBC component: Setting the PostgreSQL schema search path
> ---------------------------------------------------------
>
>                 Key: CAMEL-7904
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7904
>             Project: Camel
>          Issue Type: New Feature
>    Affects Versions: 2.13.0
>            Reporter: Camel Guy
>
> For PostgreSQL it is common to run two commands in a single transaction in order to set
the schema search path:
> set search_path to foo, public;
> select 5;
> Due to connection pooling it is desirable to combine both statements in a single operation.
> These types of queries don't work with the JDBC component because it only returns the
result set for the first command (set search_path), which is always empty.
> The easiest solution would be an option to skip the first N result sets. However, if
any of those result sets reported an error, an exception should be thrown.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message