Subject Re: [Firebird-Java] Transaction parameters + Jaybird
Author Alec Swan
> Connection connection =
DriverManager.getConnection("jdbc:firebirdsql:localhost/3050:c:/example.fdb?"+
>
"TRANSACTION_READ_COMMITTED=isc_tpb_read_committed,"+"isc_rec_version,isc_tpb_read,isc_tpb_nowait",
"SYSDBA", "masterkey");

Does Jaybird support java.sql.Connection#setTransactionIsolation(int level)
standard JDBC call? In other words, will the following code result in
transaction isolation level to be set to REPEATABLE_READ on the Jaybird
connection?

ComboPooledDataSource comboPooledDataSource = new ComboPooledDataSource();
comboPooledDataSource.setJdbcUrl("jdbc:firebirdsql:embedded:c:/example.fdb?lc_ctype=UTF8");
comboPooledDataSource.setUser(FirebirdDatabaseManager.FIREBIRD_USER_NAME);
comboPooledDataSource.setPassword(FirebirdDatabaseManager.FIREBIRD_PASSWORD);
comboPooledDataSource.setPreferredTestQuery("select current_timestamp from
rdb$database");

Connection connection = comboPooledDataSource .getConnection();
connection.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);

A side question is if there is any benefit of using FBWrappingDataSource
over c3p0 ComboPooledDataSource?

Thanks,

Alec

On Mon, Jan 24, 2011 at 10:29 PM, Roman Rokytskyy <roman@...>wrote:

>
>
> > Please disregard by first question. I just noticed that in
> > isc_tpb_mapping.properties TRANSACTION_REPEATABLE_READ has
> > isc_tpb_conCURRENCY setting and TRANSACTION_SERIALIZABLE has
> > isc_tpb_conSISTENCY. Could you tell me which one corresponds to SNAPSHOT?
>
> concurrency corresponds to SNAPSHOT, consistency corresponds to SNAPSHOT
> TABLE STABILITY.
>
> However, re. the "more concurrency", the isc_tpb_concurrency and
> isc_tpb_read_committed are pretty similar, as long as you do not use
> "isc_tpb_no_rec_version" flag for read committed.
>
> In both isolation levels writers do not block readers, so do not worry.
> The difference is when the reading transaction (TrA) "sees"
> modifications made by writing transaction (TrB). In
> isc_tpb_read_committed case that happens when TrB committs, in
> isc_tpb_concurrency it happens when TrA committs.
>
> If you have an issue when processing in TrA waits for TrB to complete,
> changing the isolation level won't really help you. Such behavior is
> related to the case when TrA tries to update the record updated in TrB.
> In read-committed case TrA will wait until TrB commits (then you get an
> error and FB allows you to re-execute your update in TrA), in
> concurrency TrA will fail at commit time.
>
> Roman
>
>


[Non-text portions of this message have been removed]