Dasfaust / GlobalMarket

Buy and sell items in a global market
Other
28 stars 59 forks source link

Unable to synchronize data #47

Closed qiuDar closed 9 years ago

qiuDar commented 9 years ago

hello! I have a problem here. I opened the two servers, use mysql to store data from GlobalMarket. But when I sell items on server A, server B without any items. Server B sell items at this time there will be a mistake. Sorry, my English is not very good, but the problem is really important to me.I hope you can help me to solve, thank you.

[GlobalMarket] Error on inserting new listing (id: 1, itemId: 1) com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1' for key 'PRIMARY' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) at com.mysql.jdbc.Util.getInstance(Util.java:382) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2407) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2325) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2310) at com.survivorserver.GlobalMarket.SQL.MarketStatement.execute(MarketStatement.java:97) at com.survivorserver.GlobalMarket.SQL.AsyncDatabase.processQueue(AsyncDatabase.java:67) at com.survivorserver.GlobalMarket.SQL.AsyncDatabase$1.run(AsyncDatabase.java:37) at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftTask.run(CraftTask.java:71) at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

Dasfaust commented 9 years ago

Hi, you can't share a database between two GlobalMarket instances, you can find more info here and here. At the moment, MySQL support is really only there because it can be.