user2889750
user2889750

Reputation: 15

Persistence configuration for CloudBees JavaEE/Glassfish application

I have a Java EE 7/Glassfish 4 application. How to configure JDBC Connection Pool and JDBC Resource in CloudBees?

The second question is, could I deploy an EAR file in CloudBees? How can I do that?

Thank you in advance.

Upvotes: 0

Views: 160

Answers (1)

valentina
valentina

Reputation: 621

You just need to create your database and bind it to your application in this way:

bees app:bind -a <account>/<appName> -db mydb

This is the equivalent of adding the jdbc resource and a jndi datasource will be created in your Glassfish4 container (have a look to the Glassfish4 Cloudbees documentation to know the valid jndi names)

If you want to create a connection pool, you would just need to add additional parameters in your command:

i.e:

bees app:bind -a APP_ID -db DB_ID -as DATASOURCE_NAME maxActive=5 maxIdle=2 \
maxWait=10000 removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true \
validationQuery="SELECT 1" testOnBorrow=true

Please refer to this documentation for additional information.

As far as I know, only the JBoss stacks support deployment of EAR files.

Upvotes: 1

Related Questions