Spark JDBC and transaction pooling in PGBouncerPostgres: INSERT if does not exist alreadyPHP and pgbouncer in transaction mode: current transaction is abortedPostgres - ERROR: prepared statement “S_1” already existsHow to configure PreparedStatement Caching with Postgres and Tomcat7 JDBC Pool?Golang - pgbouncer and transaction usageHow to increase the connection throughput for pgbouncer?Disabling prepared statements in dbcp+spring+hibernate+jdbc?Advantage of PgBouncer with WildFly/Application Server connection pool?connect_query setting in PGBouncer + JDBCHow pgbouncer care about session parameters in transaction pooling mode

What is this type of notehead called?

Have I saved too much for retirement so far?

Can someone explain how this makes sense electrically?

Why did the EU agree to delay the Brexit deadline?

Has Darkwing Duck ever met Scrooge McDuck?

We have a love-hate relationship

A Permanent Norse Presence in America

Why has "pence" been used in this sentence, not "pences"?

What is the gram­mat­i­cal term for “‑ed” words like these?

Create all possible words using a set or letters

Query about absorption line spectra

How do I extrude a face to a single vertex

Difference between -| and |- in TikZ

A social experiment. What is the worst that can happen?

Is it possible to use .desktop files to open local pdf files on specific pages with a browser?

Translation of Scottish 16th century church stained glass

How should I respond when I lied about my education and the company finds out through background check?

Should I install hardwood flooring or cabinets first?

Open a doc from terminal, but not by its name

Can I sign legal documents with a smiley face?

Did arcade monitors have same pixel aspect ratio as TV sets?

Find last 3 digits of this monster number

Some numbers are more equivalent than others

How do ground effect vehicles perform turns?



Spark JDBC and transaction pooling in PGBouncer


Postgres: INSERT if does not exist alreadyPHP and pgbouncer in transaction mode: current transaction is abortedPostgres - ERROR: prepared statement “S_1” already existsHow to configure PreparedStatement Caching with Postgres and Tomcat7 JDBC Pool?Golang - pgbouncer and transaction usageHow to increase the connection throughput for pgbouncer?Disabling prepared statements in dbcp+spring+hibernate+jdbc?Advantage of PgBouncer with WildFly/Application Server connection pool?connect_query setting in PGBouncer + JDBCHow pgbouncer care about session parameters in transaction pooling mode













1















I am using Spark JDBC DataFramReader to query Postgres DB, the query is executed threw PGBouncer working in Transaction Pooling.



From the second executed query I receive the following error:



org.postgresql.util.PSQLException: ERROR: prepared statement "S_1" already exists


Is there a workaround for this Error ?



I tried to add prepareThreshold=0 to the connection string.










share|improve this question






















  • I was using fetchSize option in the JDBC, once I removed it, the prepareThreshold=0 was sufficient

    – Alex Stanovsky
    Mar 7 at 11:23












  • I found event better solution which allows to work with fetchSize. I upgraded the jdbc driver to org.postgresql:postgresql:42.2.5

    – Alex Stanovsky
    Mar 7 at 16:02















1















I am using Spark JDBC DataFramReader to query Postgres DB, the query is executed threw PGBouncer working in Transaction Pooling.



From the second executed query I receive the following error:



org.postgresql.util.PSQLException: ERROR: prepared statement "S_1" already exists


Is there a workaround for this Error ?



I tried to add prepareThreshold=0 to the connection string.










share|improve this question






















  • I was using fetchSize option in the JDBC, once I removed it, the prepareThreshold=0 was sufficient

    – Alex Stanovsky
    Mar 7 at 11:23












  • I found event better solution which allows to work with fetchSize. I upgraded the jdbc driver to org.postgresql:postgresql:42.2.5

    – Alex Stanovsky
    Mar 7 at 16:02













1












1








1








I am using Spark JDBC DataFramReader to query Postgres DB, the query is executed threw PGBouncer working in Transaction Pooling.



From the second executed query I receive the following error:



org.postgresql.util.PSQLException: ERROR: prepared statement "S_1" already exists


Is there a workaround for this Error ?



I tried to add prepareThreshold=0 to the connection string.










share|improve this question














I am using Spark JDBC DataFramReader to query Postgres DB, the query is executed threw PGBouncer working in Transaction Pooling.



From the second executed query I receive the following error:



org.postgresql.util.PSQLException: ERROR: prepared statement "S_1" already exists


Is there a workaround for this Error ?



I tried to add prepareThreshold=0 to the connection string.







postgresql apache-spark jdbc pgbouncer spark-jdbc






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 7 at 9:08









Alex StanovskyAlex Stanovsky

261116




261116












  • I was using fetchSize option in the JDBC, once I removed it, the prepareThreshold=0 was sufficient

    – Alex Stanovsky
    Mar 7 at 11:23












  • I found event better solution which allows to work with fetchSize. I upgraded the jdbc driver to org.postgresql:postgresql:42.2.5

    – Alex Stanovsky
    Mar 7 at 16:02

















  • I was using fetchSize option in the JDBC, once I removed it, the prepareThreshold=0 was sufficient

    – Alex Stanovsky
    Mar 7 at 11:23












  • I found event better solution which allows to work with fetchSize. I upgraded the jdbc driver to org.postgresql:postgresql:42.2.5

    – Alex Stanovsky
    Mar 7 at 16:02
















I was using fetchSize option in the JDBC, once I removed it, the prepareThreshold=0 was sufficient

– Alex Stanovsky
Mar 7 at 11:23






I was using fetchSize option in the JDBC, once I removed it, the prepareThreshold=0 was sufficient

– Alex Stanovsky
Mar 7 at 11:23














I found event better solution which allows to work with fetchSize. I upgraded the jdbc driver to org.postgresql:postgresql:42.2.5

– Alex Stanovsky
Mar 7 at 16:02





I found event better solution which allows to work with fetchSize. I upgraded the jdbc driver to org.postgresql:postgresql:42.2.5

– Alex Stanovsky
Mar 7 at 16:02












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55039896%2fspark-jdbc-and-transaction-pooling-in-pgbouncer%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55039896%2fspark-jdbc-and-transaction-pooling-in-pgbouncer%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved