Re: [PHP-DEV] sapi/servlet configuration error

2002-12-06 Thread Akos Maroy
Sebastian Bergmann wrote:

Ray Hunter wrote:


Does anyone have an idea about what i need to do to fix this?



  I just tested sapi/servlet with Tomcat 4.1.12 on Windows and the
  segfaults I experienced prior to the Tony's patch are still there:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0xC34AB15
Function=zend_startup_module+0xD5
Library=E:\home\php\php4\Release_TS_inline\php4ts.dll

Current Java thread:
	at net.php.servlet.startup(Native Method)
	at net.php.servlet.init(servlet.java:156)


I have the same problem under Linux.


Akos


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] persistent java virtual machine under PHP

2002-12-06 Thread Akos Maroy
Tony J. White wrote:

After reviewing the thread, I think the problem you are experiencing is related
to the fact that each instance of PHP is running a seperate JVM.  It's not
that the JVM is being destroyed.

Therefore when you have apache running with say 5 httpd children, you will be
running 5 seperate JVM's each with it's own environment.  So if you tried
to keep a Java variable active from request to request, it would disappear
once your apache KeepAliveTimeout was up.

Does that sound about right?


well, I traced it and _never_ saw a call to jvm_destroy() in the java 
extension code.


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: persistent java virtual machine under PHP

2002-12-05 Thread Akos Maroy
Ivan Ristic wrote:


How is a persistent database connection handled then? e.g. in the
mysql module?


  Apache 1.x pre-creates a number of server processes. Each process
  handles a certain number of requests (one at a time), and then
  dies. It is then replaced with an another server process. The number
  of processes can vary depending on the load and the configuration.

  Database connections (and other resources) are persistent on the
  per-server-process level. What this means that an open connection
  in one server process cannot be reused from within another
  server process.


I see. This is sad news indeed. But is this really a closest one can get 
with apache? None of the other extension libraries for apache, like 
nsapi, provides the notion of persistent resources shared among all 
apache requestst?


Akos


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: persistent java virtual machine under PHP

2002-12-05 Thread Akos Maroy
Ivan Ristic wrote:

  No, I have been told (by someone, I do not remember) that if you
  use PHP as a servlet ext/java would use the same JVM. I haven't
  check to see whether that is correct.


sound good, I'll take a look.


Akos


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Re: persistent java virtual machine under PHP

2002-12-05 Thread Akos Maroy
Ivan Ristic wrote:

  No, I have been told (by someone, I do not remember) that if you
  use PHP as a servlet ext/java would use the same JVM. I haven't
  check to see whether that is correct.


My experiences:

using php-4.2.3, calling plain php pages from Tomcat seem to be OK. But 
when calling java code from within the PHP code, I get a native mode 
exception:


Unexpected Signal : 11 occurred at PC=0x4DAD935E
Function=zend_hash_index_update_or_next_insert+0x3A
Library=/.../php-4.2.3/libs/libphp4.so

Current Java thread:
at net.php.reflect.setResultFromObject(Native Method)
at net.php.reflect.setResult(reflect.java:105)
at net.php.servlet.readCookies(servlet.java:92)
at net.php.servlet.send(Native Method)
at net.php.servlet.service(servlet.java:188)
at net.php.servlet.service(servlet.java:212)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)



I also tried the CVS version, but I can't even compile it:


/.../php4/sapi/servlet/servlet.c: In function Java_net_php_servlet_startup':
/.../php4/sapi/servlet/servlet.c:261: warning: passing arg 2 of 
`php_module_startup' from incompatible pointer type
make: *** No rule to make target `sapi/servlet/java.c', needed by 
`sapi/servlet/java.lo'.  Stop.


What java.c is expected here? The same as in ext/java ?


Akos


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: persistent java virtual machine under PHP

2002-12-04 Thread Akos Maroy
Ivan Ristic wrote:

  I do not think that is possible, unless PHP engine itself
  is contained within a single process (and runs multithreaded).
  Which it isn't (under Apache 1.x  , at least).


I'm not familiar in general with the PHP engine, so my questions may be 
quite stupid. Anyway:

How is a persistent database connection handled then? e.g. in the mysql 
module?

looking at the mysql module source code, it seems that there is a list 
called persistent_list, used in such a manner:

zend_hash_find(EG(persistent_list), hashed_details, 
hashed_details_length+1, (void **) le

would this provide some persistnece? If yes, how to use it exaclty? (I 
couldn't make it work myself.)


It seems to me that libphp_java.so is unloaded every once in a while. 
For example, global static variable defined in the module get 
re-initialized every once in a while. Is this so?


I can't see a call to JNI_DestroyJavaVM() anywhere in the java module 
source code. Isn't this a possible reason for resource leaks? Or are 
modules that cleverly unloaded?


Akos


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php