I was doing a remote debug for a sql exception. The jar was present in the remote location. I was doing a remote debug from eclipse. Suddenly, I realised that it was throwing exception for connection.close() without a connection.commit().
So, I dropped the frame in the debug and added the connection.commit(). This worked. The connection was closed.
My question is how is this even possible? The class file was present in the jar and the code change was done locally on my eclipse..!!!
Using a debugger in Java is a bidirectional thing. The debugger can send e.g. breakpoints to the running program and the running program can send back e.g. variable contents to the debugger.
When replacing code this code can also be sent to the program running (hot code replacement).
When you restart the debugged program then the changes made by the debugger are lost again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With