Thursday, November 28, 2013

Re: com.google.cloud.sql.jdbc.internal.SQLUnknownConnectionIdException: Connection id no longer valid.

How to keep track of the validity of the connection. The use of method "emfInstance.isOpen()" can check the connection is in open state but still get this exception

Caused by: com.google.cloud.sql.jdbc.internal.SQLUnknownConnectionIdException: Invalid connection id.

Is there any method like "emfInstance.isValid()" so that we can reuse the "EntityManagerFactory" untill its still valid and open.
or would you suggest to create a new EMF instance for every db transaction.

Please help!
Aadhaar

On Saturday, February 23, 2013 7:14:43 AM UTC+5:30, Razvan Musaloiu-E. wrote:
Do you keep a connection open without using it for > 15 minutes? The per use instances have a timeout of 15 minutes. After the timeout the old connections will be invalid. I don't see any abnormal terminations for your instance.

-- Razvan ME


On Fri, Feb 22, 2013 at 5:24 PM, Fábio Peruchi <fhpe...@ciandt.com> wrote:
I'm running my queries from a linux machine (Linux version 2.6.32-5-amd64 (Debian 2.6.32-31) (b...@decadent.org.uk) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Mon Mar 7 21:35:22 UTC 2011).

My instance name is cit-sas-rederef-dev:pgs. My database name is pgs.

On Fri, Feb 22, 2013 at 10:15 PM, Razvan Musaloiu-E. <raz...@google.com> wrote:
Where do you issues the queries from? Can you tell us the instance name? Feel free to contact me directly to write to sql-...@google.com.

-- Razvan ME


On Fri, Feb 22, 2013 at 5:11 PM, Fábio Peruchi <fhpe...@ciandt.com> wrote:
Hi!

I'm running a batch process that execute several insert and delete statements on Cloud SQL. After some hours the process are running I'm getting this error:

Caused by: com.google.cloud.sql.jdbc.internal.SQLUnknownConnectionIdException: Connection id no longer valid.
at com.google.cloud.sql.jdbc.internal.Exceptions.newSqlExceptionForApplicationError(Exceptions.java:195)
at com.google.cloud.sql.jdbc.internal.Exceptions.newSqlException(Exceptions.java:211)
at com.google.cloud.sql.jdbc.internal.SqlProtoClient.check(SqlProtoClient.java:198)
at com.google.cloud.sql.jdbc.internal.SqlProtoClient.executeSql(SqlProtoClient.java:87)
at com.google.cloud.sql.jdbc.internal.SqlProtoClient.executeSql(SqlProtoClient.java:76)
at com.google.cloud.sql.jdbc.Connection.executeSql(Connection.java:528)
at com.google.cloud.sql.jdbc.PreparedStatement.executeSqlImpl(PreparedStatement.java:141)
at com.google.cloud.sql.jdbc.Statement.executeImpl(Statement.java:154)
at com.google.cloud.sql.jdbc.Statement.executeUpdateImpl(Statement.java:341)
at com.google.cloud.sql.jdbc.Statement.executeUpdate(Statement.java:336)
at com.google.cloud.sql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:134)

Can you help me?

Kind regards.

Fábio Peruchi

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/2295ad7f-989e-45e5-a847-e8ba02a8bc2e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment