Issue 1.
------------
The problem here is that when the connection for "sachin" db is allocated, autoCommit is not set of "off" for that connection.
Issue 2.
-------------
Solution:
a) In Query Analyzer, if Autocommit is disabled and user tries to switch DB, display a warning message similar to the one displayed by Informix. See attached screenshot.
b) If user does commits or rollsback and switches DB, then this DB should also be set to autoCommit off.
Issue 3.
-------------
Solution:
When user clicks on 'Clone Window with Contents' follow the same rule as opening a new Query Analyzer window
Issue 4.
-------------
PostgreSQL related problems (issues 1-3) are fixed:
SVN r34680/14.0.3-16
SVN r34681/15.0.0-dev-34
Another scenario is to execute 'USE DATABASE' manually, it would cause problem before above fixes, too.
The reason Informix prompts a dialog is because Informix does not allow users to change database context if auto-commit is off. This does not apply to PostgreSQL.
I will look into Informix problem (issue 4) on Monday.
The reason Informix prompts a dialog is because Informix does not allow users to change database context if auto-commit is off. This does not apply to PostgreSQL.
Understood, but we still need the dialog prompt to avoid user confusion. Here's an example: user connects to database X, turns off auto-commit and inserts into table abc. The user then switches to database Y, auto-commit is still off and inserts into table def. The user then says rollback. The rollback operation is only going to occur on database Y. However, the user might be confused and think that the rollback is going to occur on both Database X & Database Y. This is what happens in SQL Server b/c the server supports rolling backing a transaction across multiple DBs.
The reason Informix prompts a dialog is because Informix does not allow users to change database context if auto-commit is off. This does not apply to PostgreSQL.
Understood, but we still need the dialog prompt to avoid user confusion. Here's an example: user connects to database X, turns off auto-commit and inserts into table abc. The user then switches to database Y, auto-commit is still off and inserts into table def. The user then says rollback. The rollback operation is only going to occur on database Y. However, the user might be confused and think that the rollback is going to occur on both Database X & Database Y. This is what happens in SQL Server b/c the server supports rolling backing a transaction across multiple DBs.
PostgreSQL - prompts a dialog on database change if auto-commit is off
SVN r34701/14.0.3-19
SVN r34702/15.0.0-dev-34
Regarding Informix/issue-4, it seems that the root cause is the 'northwind' database is not configured to support transaction:
(a) When a query panel instance is created, it will call ConnectionSupport.supportTransactions() via QueryPanel.initComponents().
(b) In ConnectionSupport.supportTransactions(), ADS will test auto-commit by calling:
(b-1) connection.setAutoCommit(false);
(b-2) connection.setAutoCommit(true);
When 'northwind' database is used, (b-1) above will throw a SQLException, error message is 'Transactions not supported'. This exception is not reported, nor logged.
(c) Because ConnectionSupport.supportTransactions() return false; QueryPanel disabled 'Auto Commit' button (the current connection's auto-commit state is ON).
(d) Since current connection's auto-commit state is ON, QueryPanel did not update the states of 'Commit' button and 'Rollback' button (they are disabled).
I executed the following SQL statements in an Informix query panel:
select is_logging from sysmaster:sysdatabases where name='northwind'
go
select is_logging from sysmaster:sysdatabases where name='gui_test'
go
select is_logging from sysmaster:sysdatabases where name='sysmaster'
go
The outcomes are 0, 1, 1 respectively, look like logging is not turned on for 'northwind'.
We can discuss tomorrow to see is there any code change needed for issue 4.
PostgreSQL - prompts a dialog on database change if auto-commit is off
SVN r34701/14.0.3-19
SVN r34702/15.0.0-dev-34
Regarding Informix/issue-4, it seems that the root cause is the 'northwind' database is not configured to support transaction:
(a) When a query panel instance is created, it will call ConnectionSupport.supportTransactions() via QueryPanel.initComponents().
(b) In ConnectionSupport.supportTransactions(), ADS will test auto-commit by calling:
(b-1) connection.setAutoCommit(false);
(b-2) connection.setAutoCommit(true);
When 'northwind' database is used, (b-1) above will throw a SQLException, error message is 'Transactions not supported'. This exception is not reported, nor logged.
(c) Because ConnectionSupport.supportTransactions() return false; QueryPanel disabled 'Auto Commit' button (the current connection's auto-commit state is ON).
(d) Since current connection's auto-commit state is ON, QueryPanel did not update the states of 'Commit' button and 'Rollback' button (they are disabled).
I executed the following SQL statements in an Informix query panel:
select is_logging from sysmaster:sysdatabases where name='northwind'
go
select is_logging from sysmaster:sysdatabases where name='gui_test'
go
select is_logging from sysmaster:sysdatabases where name='sysmaster'
go
The outcomes are 0, 1, 1 respectively, look like logging is not turned on for 'northwind'.
We can discuss tomorrow to see is there any code change needed for issue 4.
Discussed with Sachin, no code changes needed for Informix/issue-4.
Discussed with Sachin, no code changes needed for Informix/issue-4.
Verified most cases discussed with Fung and the issues specified here in 14.0.3-20
Verified most cases discussed with Fung and the issues specified here in 14.0.3-20
Issue #10673 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build 14.0.3-20/15.0.0-dev-35 |
No time estimate |
4 issue links |
relates to #10690
Issue #10690Warning message pops up, if you do a Script to New Window |
relates to #10698
Issue #10698PostgreSQL - Auto Commit Off - swap DB - prompt for commit requires clicking button 2 times |
relates to #10869
Issue #10869NPE on opening a Query Window from the Server Menu |
relates to #10695
Issue #10695Connection Pooled - Commit and Rollback icons is not disabled |
PostgreSQL related problems (issues 1-3) are fixed:
SVN r34680/14.0.3-16
SVN r34681/15.0.0-dev-34
Another scenario is to execute 'USE DATABASE' manually, it would cause problem before above fixes, too.
The reason Informix prompts a dialog is because Informix does not allow users to change database context if auto-commit is off. This does not apply to PostgreSQL.
I will look into Informix problem (issue 4) on Monday.