|
From: <php...@li...> - 2009-07-22 16:06:22
|
Hi,
You could also use the JPersistenceAdapter to store your PHP/Java objects on
disc or in the database.
Please see JPersistence.php from the documentation.zip download.
Regards,
Jost Boekemeier
21. Jul 2009 9:26 nachm. schrieb am <
php...@li...>:
O wise developers,
I am trying to persist a java object (from PHP) using PHP/Java Bridge,
because interacting with that object is expensive and I don't want to
repeat calculations. I have read through the examples and the FAQ,
and done some searching through the mailing list, but found very few
references to persistence. The only references I did find used
sessions. It was fairly easy to implement persistence using a named
session, but I found that it has the problem of eventual expiration.
Is this the only way to persist an object? The FAQ seems to imply
that there is another (built-in) way, but it doesn't give any hint as
to what that might be.
I am running PHP/Java Bridge 5.4.4.2 on Tomcat 6.0.20, and connecting
to it from PHP5 running on a vanilla Apache2 install.
Thanks for your help,
- Chris Sullins
>From the FAQ:
> Q: How do I make my script state (objects or variables) persistent?
> A: If you must code it yourself: with e.g. java_session()->put("buf",
$stringBuffer)
>From the Session Sharing example:
if(is_null(java_values($session->get("counter")))) {
$session->put("counter", 1);
}
$counter = java_values($session->get("counter"));
------------------------------------------------------------------------------
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|