Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate entry Exception using GoogleAuthorizationCodeFlow with JdoCredentialStore and DataNucleus #46

Closed
wonderfly opened this issue Jan 9, 2015 · 10 comments
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@wonderfly
Copy link
Contributor

From Marian.F...@googlemail.com on July 11, 2012 14:48:07

Version of google-oauth-java-client: 1.10.1-beta?

Java environment Java 6, JEE

JDOCredentialStore causes "Duplicate entry exception" when refreshing access token with the "GoogleAuthorizationCodeFlow" and using DataNucleus Access Plattform 3.0.

Caused by: javax.jdo.JDODataStoreException: Duplicate entry 'XXXXIDXXXX' for key 'PRIMARY'
NestedThrowables:
java.sql.BatchUpdateException: Duplicate entry 'XXXXIDXXXX' for key 'PRIMARY'
at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:421)
at org.datanucleus.api.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:735)
at org.datanucleus.api.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:755)
at com.google.api.client.extensions.jdo.auth.oauth2.JdoCredentialStore.store(JdoCredentialStore.java:47)
at com.google.api.client.auth.oauth2.CredentialStoreRefreshListener.makePersistent(CredentialStoreRefreshListener.java:73)
at com.google.api.client.auth.oauth2.CredentialStoreRefreshListener.onTokenResponse(CredentialStoreRefreshListener.java:51)
at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:512)
...
Caused by: java.sql.BatchUpdateException: Duplicate entry 'XXXXIDXXXX' for key 'PRIMARY'
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2035)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1458)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
at org.datanucleus.store.rdbms.SQLController.processConnectionStatement(SQLController.java:607)
at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.release(ConnectionFactoryImpl.java:290)
at org.datanucleus.store.rdbms.request.InsertRequest.execute(InsertRequest.java:493)
at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.insertTable(RDBMSPersistenceHandler.java:166)
at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.insertObject(RDBMSPersistenceHandler.java:142) http://stackoverflow.com/questions/11420727/duplicate-entry-exception-using-googleauthorizationcodeflow-with-jdocredentialst How would you expect it to be fixed? Could this be the problem: "Modifying a persisted Object

To modify a previously persisted object you need to retrieve it (getObjectById, query, getExtent) and then modify it and its changes will be propagated to the datastore at commit of the transaction." ( http://www.datanucleus.org/products/datanucleus/jdo/pm.html )

Original issue: http://code.google.com/p/google-oauth-java-client/issues/detail?id=46

@wonderfly wonderfly added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. imported labels Jan 9, 2015
@wonderfly wonderfly self-assigned this Jan 9, 2015
@wonderfly
Copy link
Contributor Author

From yan...@google.com on July 14, 2012 04:46:16

Status: Accepted
Labels: -Priority-Medium Priority-High Milestone-Version1.11.0 Component-OAuth2

@wonderfly
Copy link
Contributor Author

From yan...@google.com on July 14, 2012 04:46:29

Cc: yan...@google.com

@wonderfly
Copy link
Contributor Author

From yan...@google.com on August 30, 2012 06:06:43

Labels: -Milestone-Version1.11.0 Milestone-Version1.11.1

@wonderfly
Copy link
Contributor Author

From yan...@google.com on September 26, 2012 05:17:39

Owner: ngmic...@google.com
Cc: rmis...@google.com
Labels: -Milestone-Version1.11.1 Milestone-Version1.12.0

@wonderfly
Copy link
Contributor Author

From yan...@google.com on October 08, 2012 12:17:44

Labels: -Milestone-Version1.12.0 Milestone-Version1.13.0

@wonderfly
Copy link
Contributor Author

From yan...@google.com on December 13, 2012 06:33:45

Labels: -Milestone-Version1.13.0 Milestone-Version1.14.0

@wonderfly
Copy link
Contributor Author

From yan...@google.com on February 04, 2013 20:47:22

Labels: -Milestone-Version1.14.0 Milestone-Version1.15.0

@wonderfly
Copy link
Contributor Author

From pele...@google.com on March 05, 2013 13:04:00

Owner: pele...@google.com
Cc: ngmic...@google.com

@wonderfly
Copy link
Contributor Author

From pele...@google.com on March 07, 2013 08:31:11

https://codereview.appspot.com/7575043/

Status: Started

@wonderfly
Copy link
Contributor Author

From pele...@google.com on April 23, 2013 12:47:48

Status: Fixed

@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants