Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><em>[From the <a href="http://wiki.cloudbees.com/bin/view/RUN/DatabaseGuide" rel="nofollow">Database Guide</a> on the CloudBees Wiki]</em></p> <p>MySQL includes a timeout that will close connections that have been idle for long periods of time. For improved Database performance, CloudBees DataSources use the Apache DBCP connection pool to reuse JDBC connections after they are closed by the application.</p> <p>If you use a connection that has been in the pool idle for too long, your application will likely experience the following error: "The last packet successfully received from the server was XXX seconds ago". </p> <p>The connection pool includes a setting the will validate and throw out dead connections when calling javax.sql.DataSource.getConnection(). To use this setting, add the following XML params to your DataSource definition in cloudbees-web.xml.</p> <pre><code>&lt;param name="validationQuery" value="SELECT 1" /&gt; &lt;param name="testOnBorrow" value="true" /&gt; </code></pre> <p>So for your resource, you should be able to do the following:</p> <pre><code>&lt;resource name="jdbc/myapp" auth="Container" type="javax.sql.DataSource"&gt; &lt;param name="username" value="myuser" /&gt; &lt;param name="password" value="mypass" /&gt; &lt;param name="url" value="jdbc:cloudbees://myurl /&gt; &lt;param name="validationQuery" value="SELECT 1" /&gt; &lt;param name="testOnBorrow" value="true" /&gt; &lt;/resource&gt; </code></pre> <p>If you are using the bees app:bind command instead of cloudbees-web.xml to inject your datasources, you can use these params as arguments to the command </p> <pre><code>bees app:bind -a APP_ID -db DB_NAME -as JNDI_ALIAS validationQuery="SELECT 1" testOnBorrow=true </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload