Quick Question: db access through thread?

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
HappyLDE
Posts: 123
Joined: Tue Sep 10, 2013 6:22 pm
Location: Belgium
Contact:

Quick Question: db access through thread?

Post by HappyLDE »

Quick question: If i have a function that accesses database (like the one below) can i use it right away or should i put it in a thread?:

Code: Select all

void functionForDb(){                try (Connection con = L2DatabaseFactory.getInstance().getConnection())        {            ..        } catch (SQLException e) { }}
If it is not put in a thread what gets blocked? The script for the user that accesses it, the script for all the ppl that accesses it, whole server, nothing? :p
Last edited by HappyLDE on Tue Nov 18, 2014 1:29 pm, edited 1 time in total.
Thank you for making L2JServer happen! :D
"If you believe you will fail or succeed, in both ways you are right." - Henry Ford
Sdw
L2j Veteran
L2j Veteran
Posts: 855
Joined: Mon May 03, 2010 8:38 am
Location: France

Re: Quick Question: db access through thread?

Post by Sdw »

That way is fine
User avatar
HappyLDE
Posts: 123
Joined: Tue Sep 10, 2013 6:22 pm
Location: Belgium
Contact:

Re: Quick Question: db access through thread?

Post by HappyLDE »

Thanks Sdw!
Thank you for making L2JServer happen! :D
"If you believe you will fail or succeed, in both ways you are right." - Henry Ford
Post Reply