users@glassfish.java.net

Re: JDBC Pool unavailable induce failed deployment

From: Olivier Chorier <lapsus63_at_gmail.com>
Date: Mon, 11 Mar 2013 16:11:27 +0100

Hello Martin and readers,

Thanks for your help. However, i tried to set poolresize to 0, but it seems
to be a forbidden value (I used admin GUI, and got an error when updating
value 2 to 0).

Just setting the steady pool size didn't change something.

I noticed that when I'm using Factory instead of IoC to setup the
EntityManagerFactory I have no problem anymore :

Old code :
    @PersistenceUnit(unitName = MyPersistence.PU_NAME)
    protected EntityManagerFactory emf;

New Code :
    protected EntityManagerFactory emf;
    @PostConstruct
    public void initManager() {
        emf = Persistence.createEntityManagerFactory(MyPersistence.PU_NAME);
    }

(Easy use case : change pool setting to inexistant IP, and deploy an EAR).

I don't know if it's a good solution, and if it doesn't implies performance
issues, but it seems to be ok with that. If GF can't reach the MySQL server
I can deploy aswell.

I'm not sure that altering the minimum pool size parameter is a convenient
way to succeed deployments even if the SQL server is not reachable, is it ?

Olivier.

2013/3/11 Martin Gainty <mgainty_at_hotmail.com>

> decrease steadypoolsize
>
>
>
> then set
>
> poolresize=0
>
>
>
> http://docs.oracle.com/cd/E19683-01/816-6443/6mch3fo6p/index.html
>
> Martin
> ______________________________________________
> Note de déni et de confidentialité
>
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>
>
>
>
>
>
> ------------------------------
> From: lapsus63_at_gmail.com
> Date: Fri, 8 Mar 2013 15:42:17 +0100
> Subject: JDBC Pool unavailable induce failed deployment
> To: users_at_glassfish.java.net
>
>
> Hello,
>
> My domain contains 2 JDBC pools. One is used for 99,99% of the
> transactions, and the other one for 0.01% for other stuff.
> I configured the persistence.xml with both persistence units.
>
> This other pool is located in a remote server that is not 100% available
> for network restrictions.
>
> When I deploy my EAR, if the secondary pool isn't available (that means
> ping timeout), the deployment fails with the following errors.
>
> How can I set my pool "optional" and allow deployment even if the jdbc
> server is not reachable ? I'd like to keep the connection parameters to
> MySQL server side.
>
> Thanks a lot for help.
> Olivier.
>
> ----
> ATTENTION: RAR5114 : Error allocating connection : [Erreur lors de
> l'allocation d'une connexion. Cause : Connection could not be allocated
> because: Communications link failure
> The last packet sent successfully to the server was 0 milliseconds ago.
> The driver has not received any packets from the server.]
> GRAVE: Local Exception Stack:
> Exception [EclipseLink-4002] (Eclipse Persistence Services -
> 2.3.2.v20111125-r10461):
> org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception: java.sql.SQLException: Erreur lors de l'allocation
> d'une connexion. Cause : Connection could not be allocated because:
> Communications link failure
> The last packet sent successfully to the server was 0 milliseconds ago.
> The driver has not received any packets from the server.
> Error Code: 0
> at
> org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:309)
> at
> org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:135)
> ...
> Caused by: java.sql.SQLException: Erreur lors de l'allocation d'une
> connexion. Cause : Connection could not be allocated because:
> Communications link failure
> The last packet sent successfully to the server was 0 milliseconds ago.
> The driver has not received any packets from the server.
> at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:120)
> at
> org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:123)
> ... 53 more
> Caused by: javax.resource.spi.ResourceAllocationException: Erreur lors de
> l'allocation d'une connexion. Cause : Connection could not be allocated
> because: Communications link failure
> The last packet sent successfully to the server was 0 milliseconds ago.
> The driver has not received any packets from the server.
> at
> com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:307)
> at
> com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:190)
> at
> com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
> at
> com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:160)
> at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:113)
> ... 54 more
> Caused by: com.sun.appserv.connectors.internal.api.PoolingException:
> Connection could not be allocated because: Communications link failure
> The last packet sent successfully to the server was 0 milliseconds ago.
> The driver has not received any packets from the server.
> at
> com.sun.enterprise.resource.pool.datastructure.RWLockDataStructure.addResource(RWLockDataStructure.java:103)
> ...
> Caused by: com.sun.appserv.connectors.internal.api.PoolingException:
> Connection could not be allocated because: Communications link failure
> The last packet sent successfully to the server was 0 milliseconds ago.
> The driver has not received any packets from the server.
> at
> com.sun.enterprise.resource.pool.ConnectionPool.createSingleResource(ConnectionPool.java:924)
> at
> com.sun.enterprise.resource.pool.ConnectionPool.createResource(ConnectionPool.java:1189)
> at
> com.sun.enterprise.resource.pool.datastructure.RWLockDataStructure.addResource(RWLockDataStructure.java:98)
> ... 70 more
> Caused by: com.sun.appserv.connectors.internal.api.PoolingException:
> Connection could not be allocated because: Communications link failure
> The last packet sent successfully to the server was 0 milliseconds ago.
> The driver has not received any packets from the server.
> at
> com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator.createResource(LocalTxConnectorAllocator.java:110)
> at
> com.sun.enterprise.resource.pool.ConnectionPool.createSingleResource(ConnectionPool.java:907)
> ... 72 more
> Caused by: javax.resource.spi.ResourceAllocationException: Connection
> could not be allocated because: Communications link failure
> The last packet sent successfully to the server was 0 milliseconds ago.
> The driver has not received any packets from the server.
> at
> com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedConnectionFactory.java:129)
> at
> com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator.createResource(LocalTxConnectorAllocator.java:87)
> ... 73 more
> Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
> Communications link failure
> The last packet sent successfully to the server was 0 milliseconds ago.
> The driver has not received any packets from the server.
> at sun.reflect.GeneratedConstructorAccessor189.newInstance(Unknown
> Source)
> ...
>
>
>