Page 1 of 1

Quick Question: db access through thread?

Posted: Tue Nov 18, 2014 1:23 pm
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

Re: Quick Question: db access through thread?

Posted: Tue Nov 18, 2014 1:25 pm
by Sdw
That way is fine

Re: Quick Question: db access through thread?

Posted: Wed Nov 19, 2014 5:47 pm
by HappyLDE
Thanks Sdw!