Subject | Re: [Firebird-Java] Setting multiple TransactionParameterBuffer constants on a pooled FBSimpleDataSource |
---|---|
Author | Mark Rotteveel |
Post date | 2018-02-27T09:08:38Z |
On 26-2-2018 23:48, blyons3@... [Firebird-Java] wrote:
all isolation levels, or just the one you want to override), for example:
TRANSACTION_READ_COMMITTED=isc_tpb_read_committed,isc_tpb_no_rec_version,isc_tpb_write,isc_tpb_wait
Specify the bundle name on property tpbMapping, eg if you create a
resource /com/example/fb/transaction.properties, then you need to
specify value com.example.fb.transaction (warning: the description in
the javadoc is incorrect).
eg <prefix>.dataSource.tpbMapping=com.example.fb.transaction
Using a data source it is not possible to define the mapping of a
isolation-level itself through a property. This feature is currently
only available through the DriverManager JDBC url.
Mark
--
Mark Rotteveel
> I can see that FBSimpleDataSource supports set/get of TPB Parameters viaDefine your own TPB mapping properties file (which can either contain
> setTpbMapping() and setTransactionParameters(). How do I set the
> following parameters on an FBSimpleDataSource connection?
>
> I need to set the following:
>
> isc_tpb_nowait, isc_tpb_read_committed, isc_tpb_no_rec_version
>
> I've already figured out that these are int constants found in the
> TransactionParameterBufferImpl class but I can't figure out how to set
> them into connection properties at runtime.
>
> It looks like I can setup a Properties bundle or define one on the fly.
> But how do I specify a collection of parameters?
>
> It looks like I'd want:TransactionParameterBufferImpl.NOWAIT,
> TransactionParameterBufferImpl.READ_COMMITTED and
> TransactionParameterBufferImpl.NO_REC_VERSION.
>
> I'm using HikariCP for my Connection Pool.
all isolation levels, or just the one you want to override), for example:
TRANSACTION_READ_COMMITTED=isc_tpb_read_committed,isc_tpb_no_rec_version,isc_tpb_write,isc_tpb_wait
Specify the bundle name on property tpbMapping, eg if you create a
resource /com/example/fb/transaction.properties, then you need to
specify value com.example.fb.transaction (warning: the description in
the javadoc is incorrect).
eg <prefix>.dataSource.tpbMapping=com.example.fb.transaction
Using a data source it is not possible to define the mapping of a
isolation-level itself through a property. This feature is currently
only available through the DriverManager JDBC url.
Mark
--
Mark Rotteveel