|
From: <php...@li...> - 2009-09-23 21:02:19
|
Jost Boekemeier wrote: > Please note that the option JAVA_PREFER_VALUES kills performance as it > checks for an exception after each call (I.e. each java call > generates a full network round-trip). Hi, Thanks for the response. I did see the JAVA_PREFER_VALUES option in the other thread I referenced and saw the warning about performance, so I want to avoid that option if at all possible. At this point my question is really more of a Java question and not so much of a bridge question, but do you have any general pointers as to a pattern I can use to handle these unchecked exceptions on the Java side without having to sprinkle declarations all thoughout my Java code? Would it be feasible to create a generic callback interface in Java and then use java_closure() on the PHP side to create the equivalent of an anonymous inner class which implements the callback interface? I could then pass this to a method on the Java side that executes the callback within the context of a transaction, and additionally handles and wraps all exceptions with a type that it explicitly declares. Would this solve the issue without the performance penalties that the JAVA_PREFER_VALUES option would? Or am I totally on the wrong track here? Thanks again. |