Wie set-Eigenschaft autoReconnect für mysql-db-url in Play Framework-Konfiguration-Datei?
Ich versuche, autoReconnect=true mysql-connection-Eigenschaft in der Anwendung.conf-Datei von meinem Play Framework 2.0-Anwendung. Aber es gibt mir die folgende Fehlermeldung :
Caused by: java.sql.SQLException: The connection property 'autoReconnect' only accepts values of the form: 'true', 'false', 'yes' or 'no'. The value 'true?useUnicode=yes' is not in this set.
Dies ist mein Verbindungszeichenfolge in der Anwendung.conf-Datei:
db.default.url="mysql://db_user:db_user@localhost/mydb?autoReconnect=true"
Ich bin versucht, in diesem Zusammenhang parameter, da bin ich immer diesen Fehler in meiner Bewerbung, nachdem er im Leerlauf für eine lange Zeit :
[error] c.j.b.ConnectionHandle - Database access problem. Killing off all remaining connections in the connection pool. SQL State = 08S01
[error] application - Failed to login the user : guest
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully
received from the server was 153,398,761 milliseconds ago.
The last packet sent successfully to the server was 153,398,762 milliseconds ago. is longer than the server configured value of 'wait_timeout'.
You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
Ich habe auch versucht die Einstellung in diesen spielen, db-Parameter, um dieses Problem beheben Problem wie hier erwähnt ( https://groups.google.com/forum/#!Thema/Spiel-framework/KzvbZ61j9Eo ), aber es hat das problem nicht lösen.
idleConnectionTestPeriod=10
testConnectionOnCheckin=true
Keine Anleitung zur Lösung des Problems wäre sehr geschätzt.
Dank.
InformationsquelleAutor invinc4u | 2013-07-27
Du musst angemeldet sein, um einen Kommentar abzugeben.
offensichtlich etwas Anhängen '?useUnicode=yes " auf den URI, so dass Sie am Ende mit
Parsen dies würde Ihnen, dass der Wert für autoReconnect ist wahr?useUnicode=yes
Graben, ein wenig, vielleicht ist deine connection pool oder data-abstraction-Layer sind, das zu tun.
jdbc:mysql://127.0.0.1:3306/Mysql?relaxAutoCommit="true"
in meiner Datei. Nur entfernt, und es funktioniert.InformationsquelleAutor Omry Yadan
Müssen Sie 2 Verbindungs-Parameter verketten mit & statt ? :
InformationsquelleAutor AIMIN PAN