[RADIATOR] Radiator's database handle

Alby alby26 at gmail.com
Thu Feb 16 08:17:26 CST 2012


Hi all,
I'm using radiator with a SQL database that stores the users' data. I've
also a PostAuthHook that writes some data on the SQL database. Up to now my
Hook connects to the database, writes the data and then disconnects. I
suspect that connecting and disconnecting each time I write to the database
is not a really good idea (expecially for the performance). I've noticed
that Radiator opens the connection to the database only the first time,
then reuses it (this is of course a better way than mine). Since the
database that I write is the same that I use on Radiator (same name, same
user and same password), is there a way to reuse the Radiator's DB handle
instead of creating a new one and destroying it each time?
At at first glance, my idea was to open the database connection with a
StartUpHook and then close with a ShutdownHook, but there is the problem on
how to share the DB handle between the three Hooks. This should be made
securely, because if an attacker is able to obtain the handler, it will be
able to read and write the database without performing authentication
first, I think. In my opinion reusing the Radiator DB handle is the best
solution if it can be implemented.
Thank you very much in advance for your help and for your attention
Alberto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.open.com.au/pipermail/radiator/attachments/20120216/21809745/attachment-0001.html 


More information about the radiator mailing list