|
From: <php...@li...> - 2010-06-17 09:18:05
|
Hi Dave,
> How would you persist an open JDBC connection across invocations of the same
PHP is essentially a "shared nothing" architecture. However, you can
store Java objects into the Java session using
java_session()->put("key", $jVal)
where $jVal is a java object implementing java.io.Serializable.
> For example the following does not work:
Of course not. Your other PHP script might be running on a different
server. Even if there's only one server, you may have more than one
java back end (see option <distributable/> in your web.xml.
You must guarantee that $jVal is available to all PHP instances.
Either use a 3 tier architecture, or make your java session
distributable or use only one java back end and store your value
there.
I don't know if your $jVal is distributable. If it's not, use a
standard 3 tier architecture.
Since we are talking about jdbc drivers; jee uses its own connection
pool. So the only thing you'll have to do is to fetch a connection
from the pool, for example by using standard JNDI lookups.
Regards,
Jost Boekemeier
|