If using the \disconnect command from the Command Line (aka via runfluidscript-bundled.sh) the occurred exception is displayed, instead an error message like inside ADStudio should be shown: "Query not sent: server is disconnected."
INPUT:
\disconnect
select 123
\go
OUTPUT:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1165)
at com.mysql.jdbc.ConnectionImpl.createStatement(ConnectionImpl.java:2486)
at com.mysql.jdbc.ConnectionImpl.createStatement(ConnectionImpl.java:2468)
at \\...\\ .\\हिñçêČάй語简�?한\\.Z⣝ꊥꉄ⠸.createStatement(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.hꅞ⠪ꌄ⠞ 6.f(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.L⡐ᡟ̺⣇ for.d(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.L⡐ᡟ̺⣇ for.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.Iꆔꂮꉘͯ static 3.execute(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.Dꅙꂯꅥꏔ public 8.run(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.L⡦͌⢓⣡.ci(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.eꑻꀪꃛ̊ 1.execute(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.bꌎ̶̈́ꐲ if float.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.pᡑꉒꍧ͛.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.kꍞ⢆ꎅᢂ.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.uᡞ͞ꉬᚹ instanceof double.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.Kꃘꏗ⠰ᡙ short.ci(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.eꑻꀪꃛ̊ 1.execute(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.Wꁫꌇꆔ⢏.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.Wꁫꌇꆔ⢏.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.yꋞꂚꂉ⡋ default.aKv(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.yꋞꂚꂉ⡋ default.execute(Unknown Source)
at com.aquafold.datastudio.RunFluidShell.main(Unknown Source)
Field | Old Value | New Value |
---|---|---|
Description | If using the \disconnect command from the Command Line (aka via runfluidscript-bundled.sh) the occurred exception is displayed, instead an error message like inside ADStudio should be shown: "Query not sent: server is disconnected." INPUT:
\disconnect
select 123
\go
OUTPUT:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1165)
at com.mysql.jdbc.ConnectionImpl.createStatement(ConnectionImpl.java:2486)
at com.mysql.jdbc.ConnectionImpl.createStatement(ConnectionImpl.java:2468)
at \\...\\ .\\हिñçêČάй語简�?한\\.Z⣝ꊥꉄ⠸.createStatement(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.hꅞ⠪ꌄ⠞ 6.f(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.L⡐ᡟ̺⣇ for.d(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.L⡐ᡟ̺⣇ for.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.Iꆔꂮꉘͯ static 3.execute(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.Dꅙꂯꅥꏔ public 8.run(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.L⡦͌⢓⣡.ci(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.eꑻꀪꃛ̊ 1.execute(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.bꌎ̶̈́ꐲ if float.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.pᡑꉒꍧ͛.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.kꍞ⢆ꎅᢂ.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.uᡞ͞ꉬᚹ instanceof double.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.Kꃘꏗ⠰ᡙ short.ci(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.eꑻꀪꃛ̊ 1.execute(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.Wꁫꌇꆔ⢏.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.Wꁫꌇꆔ⢏.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.yꋞꂚꂉ⡋ default.aKv(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.yꋞꂚꂉ⡋ default.execute(Unknown Source)
at com.aquafold.datastudio.RunFluidShell.main(Unknown Source)
|
If using the \disconnect command from the Command Line (aka via runfluidscript-bundled.sh) the occurred exception is displayed, instead an error message like inside ADStudio should be shown: "Query not sent: server is disconnected."
INPUT: |
Field | Old Value | New Value |
---|---|---|
Dev Assignee | Unassigned | NielsGron (Niels Gron) |
Field | Old Value | New Value |
---|---|---|
Description | If using the \disconnect command from the Command Line (aka via runfluidscript-bundled.sh) the occurred exception is displayed, instead an error message like inside ADStudio should be shown: "Query not sent: server is disconnected."
INPUT: |
If using the \disconnect command from the Command Line (aka via runfluidscript-bundled.sh) the occurred exception is displayed, instead an error message like inside ADStudio should be shown: "Query not sent: server is disconnected."
INPUT: |
Dev Assignee | NielsGron (Niels Gron) | funfun (Fun Fun) |
Field | Old Value | New Value |
---|---|---|
Resolution | Unreproducible | |
Resolved Date | Jun 2, 2012 4:26 AM | |
Status | New | Resolved |
I could not reproduce this any more; I got the same message as I ran it in shell:
Script error on line 4:
•Query not sent: server is disconnected
I reviewed source code, it seems that this situation has been properly handled.
Field | Old Value | New Value |
---|---|---|
Resolution | Unreproducible | |
Resolved Date | Jun 2, 2012 4:26 AM | |
Status | Resolved | Reopened |
Tested the issue again using ADStudio 12 Dev 43 on Ubuntu 12.04 calling runfluidscript-bundled.sh with a MySQL connection.
There are two situations appearing, if only calling \disconnect followed by select 123 and \go, most of the times a null message appears, the MySQLNonTransientConnectionException appears now very rarely in this case, however the Query not sent: server is disconnected message has not appeared.
INPUT:
\disconnect
select 123
\go
OUTPUT:
Script error on line 2:
null<---Unexpected null message
The second situation is when the above \disconnect command is preceded by another select 123 and \go, in this situation the MySQLNonTransientConnectionException appears all the time at every test run, additionally the exception is preceded by a varying error message.
INPUT:
select 123
\go
\disconnect
select 123
\go
OUTPUT VARIANT 1:
>[Error] Script lines: 1-2 --------------------------
Connection.close() has already been called. Invalid operation in this state.
[Executed: 6/6/2012 9:08:46 PM] [Execution: 0ms]
*Followed by the exception mentioned in the first post*
OUTPUT VARIANT 2:
>[Error] Script lines: 0-0 --------------------------
No operations allowed after connection closed.
*Followed by the exception mentioned in the first post*
OUTPUT VARIANT 3:
Statement failed: java.lang.NullPointerException
*Followed by the exception mentioned in the first post*
Tested the issue again using ADStudio 12 Dev 43 on Ubuntu 12.04 calling runfluidscript-bundled.sh with a MySQL connection.
There are two situations appearing, if only calling \disconnect followed by select 123 and \go, most of the times a null message appears, the MySQLNonTransientConnectionException appears now very rarely in this case, however the Query not sent: server is disconnected message has not appeared.
INPUT:
\disconnect
select 123
\go
OUTPUT:
Script error on line 2:
null<---Unexpected null message
The second situation is when the above \disconnect command is preceded by another select 123 and \go, in this situation the MySQLNonTransientConnectionException appears all the time at every test run, additionally the exception is preceded by a varying error message.
INPUT:
select 123
\go
\disconnect
select 123
\go
OUTPUT VARIANT 1:
>[Error] Script lines: 1-2 --------------------------
Connection.close() has already been called. Invalid operation in this state.
[Executed: 6/6/2012 9:08:46 PM] [Execution: 0ms]
*Followed by the exception mentioned in the first post*
OUTPUT VARIANT 2:
>[Error] Script lines: 0-0 --------------------------
No operations allowed after connection closed.
*Followed by the exception mentioned in the first post*
OUTPUT VARIANT 3:
Statement failed: java.lang.NullPointerException
*Followed by the exception mentioned in the first post*
Field | Old Value | New Value |
---|---|---|
Dev Assignee | funfun (Fun Fun) | NielsGron (Niels Gron) |
A workaround for this issue would be to call the \sleep command after \disconnect. If doing so, the expected error message is printed.
INPUT:
select 123
go
disconnect
sleep <--- Workaround
select 123
go
OUTPUT:
* First select 123 output goes here
Script error on line 6:
go: Query not sent: server is disconnected.
A workaround for this issue would be to call the \sleep command after \disconnect. If doing so, the expected error message is printed.
INPUT:
select 123
go
disconnect
sleep <--- Workaround
select 123
go
OUTPUT:
* First select 123 output goes here
Script error on line 6:
go: Query not sent: server is disconnected.
Field | Old Value | New Value |
---|---|---|
Dev Assignee | NielsGron (Niels Gron) | funfun (Fun Fun) |
I just tried this and I get ...
\disconnect
select 123
go
•disconnect: Disconnected
Script error on line 3:
java.lang.NullPointerException
I guess we should not get a NullPointerException ... but instead get "Query not sent: server is disconnected."
--- run.sql ---
\disconnect
select 123
go
I just tried this and I get ...
\disconnect
select 123
go
•disconnect: Disconnected
Script error on line 3:
java.lang.NullPointerException
I guess we should not get a NullPointerException ... but instead get "Query not sent: server is disconnected."
--- run.sql ---
\disconnect
select 123
go
Field | Old Value | New Value |
---|---|---|
Fixed Build | trunk/28915 | |
Resolution | Fixed | |
Resolved Date | Aug 24, 2012 11:13 PM | |
Status | Reopened | Resolved |
I was not able to reproduce this problem if my test script only contains 3 lines:
disconnect
select 123
go
The output always is:
disconnect
select 123
go
Script error on line 3:
•go: •Query not sent: server is disconnected.
I will receive the MySQLNonTransientConnectionException exception if my test script contains the followings:
connect path-to-a-server-file
select 123
go
disconnect
select 123
go
The root cause of the problem is \disconnect is not implemented correctly, it uses Swing EDT to close the current connection that causes some delay. And, that is why josekibold can work around the problem by add the 'sleep' command.
In Niels case, if you take a look the generated output, you will see
•disconnect: Disconnected
is displayed after
select 123
go
which tells you \disconnect and \go are not executed sequentially.
After this fix, the correct output should be:
disconnect
•disconnect: Disconnected
select 123
go
Script error on line 6:
•go: •Query not sent: server is disconnected.
I was not able to reproduce this problem if my test script only contains 3 lines:
disconnect
select 123
go
The output always is:
disconnect
select 123
go
Script error on line 3:
•go: •Query not sent: server is disconnected.
I will receive the MySQLNonTransientConnectionException exception if my test script contains the followings:
connect path-to-a-server-file
select 123
go
disconnect
select 123
go
The root cause of the problem is \disconnect is not implemented correctly, it uses Swing EDT to close the current connection that causes some delay. And, that is why josekibold can work around the problem by add the 'sleep' command.
In Niels case, if you take a look the generated output, you will see
•disconnect: Disconnected
is displayed after
select 123
go
which tells you \disconnect and \go are not executed sequentially.
After this fix, the correct output should be:
disconnect
•disconnect: Disconnected
select 123
go
Script error on line 6:
•go: •Query not sent: server is disconnected.
Field | Old Value | New Value |
---|---|---|
Status | Resolved | Closed |
Issue #6904 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build trunk/28915 |
No time estimate |
1 issue link |
relates to #8191
Issue #8191FS: disconnect command seems to work async. Is this by design? |
I could not reproduce this any more; I got the same message as I ran it in shell:
Script error on line 4:
•Query not sent: server is disconnected
I reviewed source code, it seems that this situation has been properly handled.