From f5ac4e313fdac6c12cc97dd77ed7aa20dde94635 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Tue, 22 May 2018 10:03:18 +0000 Subject: [PATCH] Use statement batches to prevent SQL interruptions. Contributed by Sahar. --- .../model/actor/instance/L2PcInstance.java | 13 ++++++++----- .../model/actor/instance/L2PetInstance.java | 3 ++- .../model/actor/instance/L2ServitorInstance.java | 3 ++- .../model/actor/instance/L2PcInstance.java | 13 ++++++++----- .../model/actor/instance/L2PetInstance.java | 3 ++- .../model/actor/instance/L2ServitorInstance.java | 3 ++- .../model/actor/instance/L2PcInstance.java | 13 ++++++++----- .../model/actor/instance/L2PetInstance.java | 3 ++- .../model/actor/instance/L2ServitorInstance.java | 3 ++- .../model/actor/instance/L2PcInstance.java | 13 ++++++++----- .../model/actor/instance/L2PetInstance.java | 3 ++- .../model/actor/instance/L2ServitorInstance.java | 3 ++- .../model/actor/instance/L2PcInstance.java | 14 ++++++++------ .../model/actor/instance/L2PetInstance.java | 3 ++- .../model/actor/instance/L2ServitorInstance.java | 3 ++- .../model/actor/instance/L2PcInstance.java | 13 ++++++++----- .../model/actor/instance/L2PetInstance.java | 3 ++- .../model/actor/instance/L2ServitorInstance.java | 3 ++- .../model/actor/instance/L2PcInstance.java | 13 ++++++++----- .../model/actor/instance/L2PetInstance.java | 3 ++- .../model/actor/instance/L2ServitorInstance.java | 3 ++- .../model/actor/instance/L2PcInstance.java | 13 ++++++++----- .../model/actor/instance/L2PetInstance.java | 3 ++- .../model/actor/instance/L2ServitorInstance.java | 3 ++- 24 files changed, 96 insertions(+), 57 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index b362b86428..cb18f3aede 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -7220,9 +7220,9 @@ public final class L2PcInstance extends L2Playable statement.setBoolean(6, subClass.isDualClass()); statement.setInt(7, getObjectId()); statement.setInt(8, subClass.getClassIndex()); - statement.execute(); - statement.clearParameters(); + statement.addBatch(); } + statement.executeBatch(); } catch (Exception e) { @@ -7312,8 +7312,9 @@ public final class L2PcInstance extends L2Playable statement.setInt(8, 0); // Store type 0, active buffs/debuffs. statement.setInt(9, getClassIndex()); statement.setInt(10, ++buff_index); - statement.execute(); + statement.addBatch(); } + statement.executeBatch(); } // Skills under reuse. @@ -7343,9 +7344,10 @@ public final class L2PcInstance extends L2Playable statement.setInt(8, 1); // Restore type 1, skill reuse. statement.setInt(9, getClassIndex()); statement.setInt(10, ++buff_index); - statement.execute(); + statement.addBatch(); } } + statement.executeBatch(); } } catch (Exception e) @@ -7375,9 +7377,10 @@ public final class L2PcInstance extends L2Playable ps2.setInt(3, ts.getItemObjectId()); ps2.setLong(4, ts.getReuse()); ps2.setDouble(5, ts.getStamp()); - ps2.execute(); + ps2.addBatch(); } } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java index cdee73db8d..10429b5b5b 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java @@ -1051,10 +1051,11 @@ public class L2PetInstance extends L2Summon ps2.setInt(4, skill.getSubLevel()); ps2.setInt(5, info.getTime()); ps2.setInt(6, ++buff_index); - ps2.execute(); + ps2.addBatch(); SummonEffectsTable.getInstance().getPetEffects().computeIfAbsent(getControlObjectId(), k -> new CopyOnWriteArrayList<>()).add(new SummonEffect(skill, info.getTime())); } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java index fcd45fb1b0..42bd49e7f9 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java @@ -353,7 +353,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable ps2.setInt(5, skill.getLevel()); ps2.setInt(6, info.getTime()); ps2.setInt(7, ++buff_index); - ps2.execute(); + ps2.addBatch(); // XXX: Rework me! if (!SummonEffectsTable.getInstance().getServitorEffectsOwner().containsKey(getOwner().getObjectId())) @@ -371,6 +371,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable SummonEffectsTable.getInstance().getServitorEffects(getOwner()).get(getReferenceSkill()).add(new SummonEffect(skill, info.getTime())); } + ps2.executeBatch(); } } } diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index f0a42ed2c0..03f80b57c6 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -7227,9 +7227,9 @@ public final class L2PcInstance extends L2Playable statement.setBoolean(6, subClass.isDualClass()); statement.setInt(7, getObjectId()); statement.setInt(8, subClass.getClassIndex()); - statement.execute(); - statement.clearParameters(); + statement.addBatch(); } + statement.executeBatch(); } catch (Exception e) { @@ -7319,8 +7319,9 @@ public final class L2PcInstance extends L2Playable statement.setInt(8, 0); // Store type 0, active buffs/debuffs. statement.setInt(9, getClassIndex()); statement.setInt(10, ++buff_index); - statement.execute(); + statement.addBatch(); } + statement.executeBatch(); } // Skills under reuse. @@ -7350,9 +7351,10 @@ public final class L2PcInstance extends L2Playable statement.setInt(8, 1); // Restore type 1, skill reuse. statement.setInt(9, getClassIndex()); statement.setInt(10, ++buff_index); - statement.execute(); + statement.addBatch(); } } + statement.executeBatch(); } } catch (Exception e) @@ -7382,9 +7384,10 @@ public final class L2PcInstance extends L2Playable ps2.setInt(3, ts.getItemObjectId()); ps2.setLong(4, ts.getReuse()); ps2.setDouble(5, ts.getStamp()); - ps2.execute(); + ps2.addBatch(); } } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java index cdee73db8d..10429b5b5b 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java @@ -1051,10 +1051,11 @@ public class L2PetInstance extends L2Summon ps2.setInt(4, skill.getSubLevel()); ps2.setInt(5, info.getTime()); ps2.setInt(6, ++buff_index); - ps2.execute(); + ps2.addBatch(); SummonEffectsTable.getInstance().getPetEffects().computeIfAbsent(getControlObjectId(), k -> new CopyOnWriteArrayList<>()).add(new SummonEffect(skill, info.getTime())); } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java index fcd45fb1b0..42bd49e7f9 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java @@ -353,7 +353,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable ps2.setInt(5, skill.getLevel()); ps2.setInt(6, info.getTime()); ps2.setInt(7, ++buff_index); - ps2.execute(); + ps2.addBatch(); // XXX: Rework me! if (!SummonEffectsTable.getInstance().getServitorEffectsOwner().containsKey(getOwner().getObjectId())) @@ -371,6 +371,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable SummonEffectsTable.getInstance().getServitorEffects(getOwner()).get(getReferenceSkill()).add(new SummonEffect(skill, info.getTime())); } + ps2.executeBatch(); } } } diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 795b01feba..f6f6d450e4 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -7229,9 +7229,9 @@ public final class L2PcInstance extends L2Playable statement.setBoolean(6, subClass.isDualClass()); statement.setInt(7, getObjectId()); statement.setInt(8, subClass.getClassIndex()); - statement.execute(); - statement.clearParameters(); + statement.addBatch(); } + statement.executeBatch(); } catch (Exception e) { @@ -7321,8 +7321,9 @@ public final class L2PcInstance extends L2Playable statement.setInt(8, 0); // Store type 0, active buffs/debuffs. statement.setInt(9, getClassIndex()); statement.setInt(10, ++buff_index); - statement.execute(); + statement.addBatch(); } + statement.executeBatch(); } // Skills under reuse. @@ -7352,9 +7353,10 @@ public final class L2PcInstance extends L2Playable statement.setInt(8, 1); // Restore type 1, skill reuse. statement.setInt(9, getClassIndex()); statement.setInt(10, ++buff_index); - statement.execute(); + statement.addBatch(); } } + statement.executeBatch(); } } catch (Exception e) @@ -7384,9 +7386,10 @@ public final class L2PcInstance extends L2Playable ps2.setInt(3, ts.getItemObjectId()); ps2.setLong(4, ts.getReuse()); ps2.setDouble(5, ts.getStamp()); - ps2.execute(); + ps2.addBatch(); } } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java index cdee73db8d..10429b5b5b 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java @@ -1051,10 +1051,11 @@ public class L2PetInstance extends L2Summon ps2.setInt(4, skill.getSubLevel()); ps2.setInt(5, info.getTime()); ps2.setInt(6, ++buff_index); - ps2.execute(); + ps2.addBatch(); SummonEffectsTable.getInstance().getPetEffects().computeIfAbsent(getControlObjectId(), k -> new CopyOnWriteArrayList<>()).add(new SummonEffect(skill, info.getTime())); } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java index fcd45fb1b0..42bd49e7f9 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java @@ -353,7 +353,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable ps2.setInt(5, skill.getLevel()); ps2.setInt(6, info.getTime()); ps2.setInt(7, ++buff_index); - ps2.execute(); + ps2.addBatch(); // XXX: Rework me! if (!SummonEffectsTable.getInstance().getServitorEffectsOwner().containsKey(getOwner().getObjectId())) @@ -371,6 +371,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable SummonEffectsTable.getInstance().getServitorEffects(getOwner()).get(getReferenceSkill()).add(new SummonEffect(skill, info.getTime())); } + ps2.executeBatch(); } } } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index a58e00b121..9b90513b4c 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -7226,9 +7226,9 @@ public final class L2PcInstance extends L2Playable statement.setBoolean(6, subClass.isDualClass()); statement.setInt(7, getObjectId()); statement.setInt(8, subClass.getClassIndex()); - statement.execute(); - statement.clearParameters(); + statement.addBatch(); } + statement.executeBatch(); } catch (Exception e) { @@ -7318,8 +7318,9 @@ public final class L2PcInstance extends L2Playable statement.setInt(8, 0); // Store type 0, active buffs/debuffs. statement.setInt(9, getClassIndex()); statement.setInt(10, ++buff_index); - statement.execute(); + statement.addBatch(); } + statement.executeBatch(); } // Skills under reuse. @@ -7349,9 +7350,10 @@ public final class L2PcInstance extends L2Playable statement.setInt(8, 1); // Restore type 1, skill reuse. statement.setInt(9, getClassIndex()); statement.setInt(10, ++buff_index); - statement.execute(); + statement.addBatch(); } } + statement.executeBatch(); } } catch (Exception e) @@ -7381,9 +7383,10 @@ public final class L2PcInstance extends L2Playable ps2.setInt(3, ts.getItemObjectId()); ps2.setLong(4, ts.getReuse()); ps2.setDouble(5, ts.getStamp()); - ps2.execute(); + ps2.addBatch(); } } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java index cdee73db8d..10429b5b5b 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java @@ -1051,10 +1051,11 @@ public class L2PetInstance extends L2Summon ps2.setInt(4, skill.getSubLevel()); ps2.setInt(5, info.getTime()); ps2.setInt(6, ++buff_index); - ps2.execute(); + ps2.addBatch(); SummonEffectsTable.getInstance().getPetEffects().computeIfAbsent(getControlObjectId(), k -> new CopyOnWriteArrayList<>()).add(new SummonEffect(skill, info.getTime())); } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java index fcd45fb1b0..42bd49e7f9 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java @@ -353,7 +353,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable ps2.setInt(5, skill.getLevel()); ps2.setInt(6, info.getTime()); ps2.setInt(7, ++buff_index); - ps2.execute(); + ps2.addBatch(); // XXX: Rework me! if (!SummonEffectsTable.getInstance().getServitorEffectsOwner().containsKey(getOwner().getObjectId())) @@ -371,6 +371,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable SummonEffectsTable.getInstance().getServitorEffects(getOwner()).get(getReferenceSkill()).add(new SummonEffect(skill, info.getTime())); } + ps2.executeBatch(); } } } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 3dd8568ae4..4e8a91d3b2 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -7389,10 +7389,9 @@ public final class L2PcInstance extends L2Playable ps.setInt(4, subClass.getClassId()); ps.setInt(5, getObjectId()); ps.setInt(6, subClass.getClassIndex()); - - ps.execute(); - ps.clearParameters(); + ps.addBatch(); } + ps.executeBatch(); } catch (Exception e) { @@ -7468,8 +7467,9 @@ public final class L2PcInstance extends L2Playable statement.setInt(7, 0); // Store type 0, active buffs/debuffs. statement.setInt(8, getClassIndex()); statement.setInt(9, ++buff_index); - statement.execute(); + statement.addBatch(); } + statement.executeBatch(); } // Skills under reuse. @@ -7498,9 +7498,10 @@ public final class L2PcInstance extends L2Playable statement.setInt(7, 1); // Restore type 1, skill reuse. statement.setInt(8, getClassIndex()); statement.setInt(9, ++buff_index); - statement.execute(); + statement.addBatch(); } } + statement.executeBatch(); } } catch (Exception e) @@ -7530,9 +7531,10 @@ public final class L2PcInstance extends L2Playable ps2.setInt(3, ts.getItemObjectId()); ps2.setLong(4, ts.getReuse()); ps2.setLong(5, ts.getStamp()); - ps2.execute(); + ps2.addBatch(); } } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java index 82116f482d..06e35fa600 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java @@ -1028,10 +1028,11 @@ public class L2PetInstance extends L2Summon ps2.setInt(3, skill.getLevel()); ps2.setInt(4, info.getTime()); ps2.setInt(5, ++buff_index); - ps2.execute(); + ps2.addBatch(); SummonEffectsTable.getInstance().addPetEffect(getControlObjectId(), skill, info.getTime()); } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java index f1771c151e..2f44398d04 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java @@ -274,10 +274,11 @@ public class L2ServitorInstance extends L2Summon implements Runnable ps2.setInt(5, skill.getLevel()); ps2.setInt(6, info.getTime()); ps2.setInt(7, ++buff_index); - ps2.execute(); + ps2.addBatch(); SummonEffectsTable.getInstance().addServitorEffect(getOwner(), getReferenceSkill(), skill, info.getTime()); } + ps2.executeBatch(); } } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index a4c48db5ab..b75a7c7328 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -7192,9 +7192,9 @@ public final class L2PcInstance extends L2Playable statement.setBoolean(6, subClass.isDualClass()); statement.setInt(7, getObjectId()); statement.setInt(8, subClass.getClassIndex()); - statement.execute(); - statement.clearParameters(); + statement.addBatch(); } + statement.executeBatch(); } catch (Exception e) { @@ -7284,8 +7284,9 @@ public final class L2PcInstance extends L2Playable statement.setInt(8, 0); // Store type 0, active buffs/debuffs. statement.setInt(9, getClassIndex()); statement.setInt(10, ++buff_index); - statement.execute(); + statement.addBatch(); } + statement.executeBatch(); } // Skills under reuse. @@ -7315,9 +7316,10 @@ public final class L2PcInstance extends L2Playable statement.setInt(8, 1); // Restore type 1, skill reuse. statement.setInt(9, getClassIndex()); statement.setInt(10, ++buff_index); - statement.execute(); + statement.addBatch(); } } + statement.executeBatch(); } } catch (Exception e) @@ -7347,9 +7349,10 @@ public final class L2PcInstance extends L2Playable ps2.setInt(3, ts.getItemObjectId()); ps2.setLong(4, ts.getReuse()); ps2.setDouble(5, ts.getStamp()); - ps2.execute(); + ps2.addBatch(); } } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java index cdee73db8d..10429b5b5b 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java @@ -1051,10 +1051,11 @@ public class L2PetInstance extends L2Summon ps2.setInt(4, skill.getSubLevel()); ps2.setInt(5, info.getTime()); ps2.setInt(6, ++buff_index); - ps2.execute(); + ps2.addBatch(); SummonEffectsTable.getInstance().getPetEffects().computeIfAbsent(getControlObjectId(), k -> new CopyOnWriteArrayList<>()).add(new SummonEffect(skill, info.getTime())); } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java index fcd45fb1b0..42bd49e7f9 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java @@ -353,7 +353,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable ps2.setInt(5, skill.getLevel()); ps2.setInt(6, info.getTime()); ps2.setInt(7, ++buff_index); - ps2.execute(); + ps2.addBatch(); // XXX: Rework me! if (!SummonEffectsTable.getInstance().getServitorEffectsOwner().containsKey(getOwner().getObjectId())) @@ -371,6 +371,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable SummonEffectsTable.getInstance().getServitorEffects(getOwner()).get(getReferenceSkill()).add(new SummonEffect(skill, info.getTime())); } + ps2.executeBatch(); } } } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 12accea41a..e0a9764e73 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -7192,9 +7192,9 @@ public final class L2PcInstance extends L2Playable statement.setBoolean(6, subClass.isDualClass()); statement.setInt(7, getObjectId()); statement.setInt(8, subClass.getClassIndex()); - statement.execute(); - statement.clearParameters(); + statement.addBatch(); } + statement.executeBatch(); } catch (Exception e) { @@ -7284,8 +7284,9 @@ public final class L2PcInstance extends L2Playable statement.setInt(8, 0); // Store type 0, active buffs/debuffs. statement.setInt(9, getClassIndex()); statement.setInt(10, ++buff_index); - statement.execute(); + statement.addBatch(); } + statement.executeBatch(); } // Skills under reuse. @@ -7315,9 +7316,10 @@ public final class L2PcInstance extends L2Playable statement.setInt(8, 1); // Restore type 1, skill reuse. statement.setInt(9, getClassIndex()); statement.setInt(10, ++buff_index); - statement.execute(); + statement.addBatch(); } } + statement.executeBatch(); } } catch (Exception e) @@ -7347,9 +7349,10 @@ public final class L2PcInstance extends L2Playable ps2.setInt(3, ts.getItemObjectId()); ps2.setLong(4, ts.getReuse()); ps2.setDouble(5, ts.getStamp()); - ps2.execute(); + ps2.addBatch(); } } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java index cdee73db8d..10429b5b5b 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java @@ -1051,10 +1051,11 @@ public class L2PetInstance extends L2Summon ps2.setInt(4, skill.getSubLevel()); ps2.setInt(5, info.getTime()); ps2.setInt(6, ++buff_index); - ps2.execute(); + ps2.addBatch(); SummonEffectsTable.getInstance().getPetEffects().computeIfAbsent(getControlObjectId(), k -> new CopyOnWriteArrayList<>()).add(new SummonEffect(skill, info.getTime())); } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java index fcd45fb1b0..42bd49e7f9 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java @@ -353,7 +353,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable ps2.setInt(5, skill.getLevel()); ps2.setInt(6, info.getTime()); ps2.setInt(7, ++buff_index); - ps2.execute(); + ps2.addBatch(); // XXX: Rework me! if (!SummonEffectsTable.getInstance().getServitorEffectsOwner().containsKey(getOwner().getObjectId())) @@ -371,6 +371,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable SummonEffectsTable.getInstance().getServitorEffects(getOwner()).get(getReferenceSkill()).add(new SummonEffect(skill, info.getTime())); } + ps2.executeBatch(); } } } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 393497b6df..512a9f441b 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -7194,9 +7194,9 @@ public final class L2PcInstance extends L2Playable statement.setBoolean(6, subClass.isDualClass()); statement.setInt(7, getObjectId()); statement.setInt(8, subClass.getClassIndex()); - statement.execute(); - statement.clearParameters(); + statement.addBatch(); } + statement.executeBatch(); } catch (Exception e) { @@ -7286,8 +7286,9 @@ public final class L2PcInstance extends L2Playable statement.setInt(8, 0); // Store type 0, active buffs/debuffs. statement.setInt(9, getClassIndex()); statement.setInt(10, ++buff_index); - statement.execute(); + statement.addBatch(); } + statement.executeBatch(); } // Skills under reuse. @@ -7317,9 +7318,10 @@ public final class L2PcInstance extends L2Playable statement.setInt(8, 1); // Restore type 1, skill reuse. statement.setInt(9, getClassIndex()); statement.setInt(10, ++buff_index); - statement.execute(); + statement.addBatch(); } } + statement.executeBatch(); } } catch (Exception e) @@ -7349,9 +7351,10 @@ public final class L2PcInstance extends L2Playable ps2.setInt(3, ts.getItemObjectId()); ps2.setLong(4, ts.getReuse()); ps2.setDouble(5, ts.getStamp()); - ps2.execute(); + ps2.addBatch(); } } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java index cdee73db8d..10429b5b5b 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java @@ -1051,10 +1051,11 @@ public class L2PetInstance extends L2Summon ps2.setInt(4, skill.getSubLevel()); ps2.setInt(5, info.getTime()); ps2.setInt(6, ++buff_index); - ps2.execute(); + ps2.addBatch(); SummonEffectsTable.getInstance().getPetEffects().computeIfAbsent(getControlObjectId(), k -> new CopyOnWriteArrayList<>()).add(new SummonEffect(skill, info.getTime())); } + ps2.executeBatch(); } } catch (Exception e) diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java index fcd45fb1b0..42bd49e7f9 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java @@ -353,7 +353,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable ps2.setInt(5, skill.getLevel()); ps2.setInt(6, info.getTime()); ps2.setInt(7, ++buff_index); - ps2.execute(); + ps2.addBatch(); // XXX: Rework me! if (!SummonEffectsTable.getInstance().getServitorEffectsOwner().containsKey(getOwner().getObjectId())) @@ -371,6 +371,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable SummonEffectsTable.getInstance().getServitorEffects(getOwner()).get(getReferenceSkill()).add(new SummonEffect(skill, info.getTime())); } + ps2.executeBatch(); } } }