简体   繁体   中英

Understanding two SQL windows in PL/SQL Developer

Is it a correct understanding that queries run in two SQL windows in PL/SQL Developer are executed as two separate transactions? (I tend to conclude this based on the fact that the results of a modification query issued in one window are not reflected in the results of a SELECT query issued in another window). If this understanding is correct, what is the utility of that given that the two transactions share a single connection?

Two transactions cannot share a single connection. If each window is a separate transaction, each window would open a separate connection to the database. If you have two transactions, you have two sessions.

If you want to see whether the different windows are using different connections, you can run

select sys_context( 'USERENV', 'SID' ) from dual;

If you get the same result in both windows, you have a single connection and a single transaction. If you get different results, you have different connections.

"Session Mode" is configurable via the preference settings. The default is "Multi-Session", in which each window runs in its own session.

The other options are "Dual Session" (my preferred setting), in which all windows share one session while the schema browser, session monitor, compilations etc use a second session, or "Single Session" where the whole application uses a single session.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM