Mantis - Quercus
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
2093 | minor | always | 10-19-07 10:26 | 10-19-07 11:32 | |
|
|||||
Reporter: | koreth | Platform: | |||
Assigned To: | ferg | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 3.1.3 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 3.1.4 | ||
|
|||||
Summary: | 0002093: Null pointer exception in Env.getConnection() | ||||
Description: |
When the remote side closed a MySQL connection, the latest code was trying to recover (this is with "ping" specified in the <database-default> section of the web app's resin-web.xml). But it ended up getting a NullPointerException the next time the PHP code called mysql_connect(). The connect call then fails. This is probably a sign of a deeper bug but the following patch fixes the immediate problem and seems like a good sanity check in any case: --- a/modules/quercus/src/com/caucho/quercus/env/Env.java +++ b/modules/quercus/src/com/caucho/quercus/env/Env.java @@ -692,7 +692,7 @@ public class Env { Connection conn; - if (oldEntry != null && ! oldEntry.getConnection().isClosed()) + if (oldEntry != null && oldEntry.getConnection() != null && ! oldEntry.getConnection().isClosed()) conn = oldEntry.getConnection(); else { if (userName == null || userName.equals("")) |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
There are no notes attached to this issue. |