0


What options can be? Why the isolation level of DataBase doesn't change? I have local DataBase and connect to them with:

connect = DriverManager.getConnection("jdbc:sqlserver://"
                        + "localhost;IntegratedSecurity=True;"
                        + "databaseName=" + TestsConstants.DB_NAME + "; ");

Then I use this method for set TRANSACTION_READ_UNCOMMITTED level:

    public static void setTransaction() {
    try {
        connect.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
        connect.setAutoCommit(false);
    } catch (SQLException e) {
        e.printStackTrace();
    }
}

I recheck isolation level:

System.out.println(connect.getTransactionIsolation());

And receive 1. That's right.
Then I insert some data in my DB, and stops on BreackPoint in my Java code.
Transaction not close yet.

Now I try to read data with SELECT operator from other process, for example from "Microsoft SQL Server Management Studio" or from "Micosoft Visual Studio" or from my local WebSite. And it`s fail.
Query execution freezes until Transaction is not commiting from Java code.

Help me, please, what is wrong in this algorithm?
What can I do for READ_UNCOMMITTED changes from DB?

  • Setting READ_UNCOMMITTED on the transaction started by the Java program won't change the isolation level of the transaction used by Visual Studio. If Visual Studio still uses READ_COMMITTED, then it's not surprising that its query freezes until the Java transaction has ended. – JB Nizet Jul 04 '15 at 20:55
  • You turned over my understanding of isolation level. So, I sets up not my transaction isolation, but isolation-penetrating ability of my transaction. Thank you, it`s work! – Artem Pozdeev Jul 05 '15 at 09:09

1 Answers1

0

In this way I set up the isolation-penetrating ability of my transaction but not the isolation of it.
To reach the data from another transaction I have to change the isolation level of this another transaction.