about photon using db

Options
ymlyjq
edited July 2013 in Photon Server
these days, i appear here tooooooo offten , thanks for helping me ,for your looking at my poor english :oops:

now,
i what to know how to use mysql db in photon;

in photon sample,lite or litelobby,
one message may be one thread deal, is that true ?

[code2=csharp]public DBReader GetDB(string str)
{
DBReader mydb = null;
Monitor.Enter(m_DBQueue);
try
{
if (m_DBQueue.Count > 0)
{
mydb = m_DBQueue.Dequeue();
mydb.strUser = str;
}
}
catch (System.Exception ex)
{
Log.ErrorFormat(ex.Message);
}
finally
{
Monitor.Exit(m_DBQueue);
}
return mydb;
}
public void RecyDB(DBReader drd)
{
Monitor.Enter(m_DBQueue);
drd.strUser = string.Empty;
m_DBQueue.Enqueue(drd);
Monitor.Exit(m_DBQueue);
}[/code2]

have any propose?

Comments

  • Hello,

    I really don't understand your question, sorry - and I think you're question is more about best practices for MySQL and not about Photon. Sorry again, we can not give support for 3rd-Party-Libraries or general programming advice here. (But maybe someone else from the community could share some tips & tricks.)

    If your question is about Photon, then can you please try and explain what exactly you want to know?