Jump to content
  • 0

Database Table Failing To Store Or Update Data!


Alexi

Question

Hello guys , i would like some help here please.
I'm working on 350rev acis pack and today i implemented masterio's pvp rank system into it , it's working except from one problem!!!
Some tables won't get their data stored on shutdown or restart and i will get an error when the scheduled table update is running.
Note : this "pvp system" needs javolution , so i installed the jar via eclipse , *i took javolution from l2j server hi5*

27xf8di.png

 

L2DatabaseFactory.java

	public Connection getConnection()
	{
		Connection con = null;
		
		while (con == null)
		{
			try
			{
Line 142		con = _source.getConnection();
			}
			catch (SQLException e)
			{
				_log.warning("L2DatabaseFactory: getConnection() failed, trying again " + e);
			}
		}
		return con;
	}

PvpTable.java

	public int[] updateDB()
	{
		int[] result = {0, 0, 0};
		
		int insertCount = 0;					// count of insert queries
		int updateCount = 0;					// count of update queries
		
		Connection con = null;
		Statement statement = null;
		
		try
		{
Line 362		con = L2DatabaseFactory.getInstance().getConnection();
			statement = con.createStatement();

Shutdown.java

			// Rank PvP System by Masterio:
			if (RankPvpSystemConfig.RANK_PVP_SYSTEM_ENABLED)
		{
Line 225		int[] up = PvpTable.getInstance().updateDB();
							
			if(up[0] == 0)
		{
				_log.info("PvpTable: Data saved ["+up[1]+" inserts and "+up[2]+" updates].");
		}
		}


Shutdown.java

			// shutdown: send warnings and then call exit to start shutdown sequence
			countdown();
			
			switch (_shutdownMode)
			{
				case GM_SHUTDOWN:
					SingletonHolder._instance.setMode(GM_SHUTDOWN);
					SingletonHolder._instance.run();
					System.exit(0);
					break;
				case GM_RESTART:
					SingletonHolder._instance.setMode(GM_RESTART);
Line 277				SingletonHolder._instance.run();
					System.exit(2);
					break;
			}

Edit : This error appeared in console 3-4 minutes later.
2cmoufa.png

 

 

Any suggestions ?

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

If it only happens on your customs, you probably got a ressource leak. Use regular try-with-ressources statement (any aCis db connection uses it to avoid ressource leak).

Link to comment
Share on other sites

  • 0

If it only happens on your customs, you probably got a ressource leak. Use regular try-with-ressources statement (any aCis db connection uses it to avoid ressource leak).

Thank you so much for your reply!!!

 

Problem solved.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • Shaper price updated to 700e. 
    • very trusted and very skilled developer, good luck with your project and sales!
    • There is nothing you can do about it, as Tryskell said forums are "deprecated" now and 95 % of the people use Discord as it offers everything and fast. Also MMO games are mostly dead so I don't know what community you expect to attract. 
    • Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore11      QUOTE    0   Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore11      QUOTE    0   Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore11      QUOTE    0   Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore11      QUOTE    0  
  • Topics

×
×
  • Create New...