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

    • i tryed to copy the admin    serverinfo.htm  to the communityboard.  the command  %onlineALL%  but it does not work.   any advice?   <html><title>Admin Server Info</title><body> <center> <table width=270> <tr> <td width=45><button value="Main" action="bypass -h admin_admin" width=45 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> <td width=180><center>Server Info</center></td> <td width=45><button value="Back" action="bypass -h admin_admin4" width=45 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> </tr> </table> <br> <font color="LEVEL">General:<font><br1> <table width="270" border="0" bgcolor="444444"> <tr> <td>OS:</td> <td><font color="00FF00">%os_name%</font></td> </tr> <tr> <td>OS version:</td> <td><font color="00FF00">%os_ver%</font></td> </tr> <tr> <td>Server slots:</td> <td><font color="00FF00">%slots%</font></td> </tr> <tr> <td>Server UpTime:</td> <td><font color="00FF00">%serverUpTime%</font></td> </tr> <tr> <td>Server Time:</td> <td><font color="00FF00">%serverTime%</font></td> </tr> <tr> <td>Game Time:</td> <td><font color="00FF00">%gameTime% (%dayNight%)</font></td> </tr> <tr> <td>Pathfinding:</td> <td><font color="00FF00">%geodata%</font></td> </tr> </table> <br> <font color="LEVEL">Players:<font><br1> <table width="270" border="0" bgcolor="444444"> <tr> <td>Total players count:</td> <td><font color="00FF00">%onlineAll%</font></td> </tr> <tr> <td>Offline trade count:</td> <td><font color="00FF00">%offlineTrade%</font></td> </tr> <tr> <td>Online GM count:</td> <td><font color="00FF00">%onlineGM%</font></td> </tr> <tr> <td>Real player count:</td> <td><font color="00FF00">%onlineReal%</font></td> </tr> </table> <br> <font color="LEVEL">Memory:<font><br1> <table width="270" border="0" bgcolor="444444"> <tr> <td>Used Memory:</td> <td><font color="00FF00">%usedMem% MB</font></td> </tr> <tr> <td>Free Memory:</td> <td><font color="00FF00">%freeMem% MB</font></td> </tr> <tr> <td>Total Memory:</td> <td><font color="00FF00">%totalMem% MB</font></td> </tr> </table> </center> </body></html>  
    • IntelliJ IDE has native support for Gradle, as far as I'm aware.
    • please is any one here that can  take the surces from grable to normal eclipse and reshare it here cause i don't have any clue how to install them On Eclipse 😕  if is any one here that can understand how those surces can be instaled please any help gonna be perfect iven i can  pay bay paypal. thanks
    • Wts A/S grade gear (armors weapons jewelery) Great Wolf with top eq Kokabora lvl 55+  Baium zaken frintezza   ADENA - 1kk - 0.25$ (big stock)   I can sell grand khavatarii with noblesse and subclass with email (can be with gear or clear)    Payment by PayPal, can use middleman   PM here  
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock