ahmedsuffian / aionxemu

Automatically exported from code.google.com/p/aionxemu
0 stars 0 forks source link

Legion Announcement doesn't save to DB #139

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
YOU MUST BE USING AION X EMU FILES ONLY!! IF ANY MODIFICATIONS WERE DONE TO
THE FILES THAT WERE NOT INCLUDED WITH THE SVN, WE WILL NOT SUPPORT THOSE
ISSUES HERE!!

Core revision: 190 (Linux)

Bug description:
Legion Announcements do not save to DB

What steps will reproduce the problem?:
Using the Legion menu to make an announcement sends the announcement out, but 
it is not saved to the Legion_announcement DB. 
This error is printed in the console log:

[WARN] 2011-03-20 15:13:32 - com.aionemu.commons.database.DB:321 - Failed to 
execute IU query 
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: 
Cannot add or update a child row: a foreign key constraint fails 
(`ac_server_gs`.`legion_announcement_list`, CONSTRAINT 
`legion_announcement_list_ibfk_1` FOREIGN KEY (`legion_id`) REFERENCES 
`legions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: 
Cannot add or update a child row: a foreign key constraint fails 
(`ac_server_gs`.`legion_announcement_list`, CONSTRAINT 
`legion_announcement_list_ibfk_1` FOREIGN KEY (`legion_id`) REFERENCES 
`legions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
        at com.mysql.jdbc.Util.getInstance(Util.java:384)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1041)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113)
        at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1364)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
        at mysql5.MySQL5LegionDAO$6.handleInsertUpdate(MySQL5LegionDAO.java]:316)
        at com.aionemu.commons.database.DB.insertUpdate(DB.java:314)
        at com.aionemu.commons.database.DB.insertUpdate(DB.java:293)
        at mysql5.MySQL5LegionDAO.saveNewAnnouncement(MySQL5LegionDAO.java]:308)
        at gameserver.services.LegionService.storeNewAnnouncement(LegionService.java:1122)
        at gameserver.services.LegionService.changeAnnouncement(LegionService.java:1093)
        at gameserver.services.LegionService.handleLegionRequest(LegionService.java:1317)
        at gameserver.network.aion.clientpackets.CM_LEGION.runImpl(CM_LEGION.java:153)
        at gameserver.network.aion.AionClientPacket.run(AionClientPacket.java:64)
        at com.aionemu.commons.utils.concurrent.ExecuteWrapper.execute(ExecuteWrapper.java:54)
        at gameserver.taskmanager.FIFORunnableQueue.removeAndExecuteFirst(FIFORunnableQueue.java:28)
        at gameserver.taskmanager.FIFOExecutableQueue.run(FIFOExecutableQueue.java:65)
        at com.aionemu.commons.utils.concurrent.ExecuteWrapper.execute(ExecuteWrapper.java:54)
        at com.aionemu.commons.utils.concurrent.ExecuteWrapper.run(ExecuteWrapper.java:39)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:636)

What is the expected output?:

Please copy/paste errors below:

Original issue reported on code.google.com by LeonvanH...@gmail.com on 20 Mar 2011 at 1:33

GoogleCodeExporter commented 9 years ago
Got a fix will be committed soon.

Original comment by ZeroSign...@gmail.com on 22 Mar 2011 at 11:48

GoogleCodeExporter commented 9 years ago
Committed Revision 204.

MySQL5LegionDAO.saveNewAnnouncement added LegionId exists check.

Original comment by ZeroSign...@gmail.com on 22 Mar 2011 at 1:54

GoogleCodeExporter commented 9 years ago

Original comment by ZeroSign...@gmail.com on 22 Mar 2011 at 1:55

GoogleCodeExporter commented 9 years ago

Original comment by ZeroSign...@gmail.com on 6 Apr 2011 at 2:14