Oracle Database Link knowledge

Source: Internet
Author: User

Maxactive is the maximum number of activated connections. The value is 20, indicating that a maximum of 20 databases can be connected at the same time.
.

 

Maxidle is the maximum number of idle connections. The value here is 20, indicating that 20 idle connections can be maintained even if no database connection is available.

The connection is not cleared and is on standby.

 

Maxwait is the maximum number of waiting seconds. The value-1 indicates unlimited waiting

It can also be set to 9000, indicating timeout after 9 seconds.

Maxwait = 5000
Maxactive = 50
Maxidle = 5

 

==================== Transaction isolation level ================

1: propagation_required
Adding the transaction to be executed is not in another transaction, so a new transaction starts.
For example, serviceb. the transaction level of methodb is defined as propagation_required. servicea. methoda has started the transaction and calls serviceb. methodb, serviceb. methodb sees that it is already running in servicea. within a methoda transaction, there will be no new transactions. However, if servicea. methoda finds that it is not in the transaction, it will assign a transaction to it. In this way, the transaction will be rolled back if an exception occurs in servicea. methoda or anywhere in serviceb. methodb.
2: propagation_supports
If the current transaction is running in the form of a transaction, and if it is not in the current transaction, it will run in the form of a non-transaction
3: propagation_mandatory
It must be run in a transaction. That is to say, it can only be called by one parent transaction. Otherwise, an exception is thrown.
4: propagation_requires_new
For example, we design servicea. methoda's transaction level as propagation_required, serviceb. methodb's transaction level as propagation_requires_new, landscaper-academy.com
Then, when serviceb is executed. in methodb, servicea. the transaction where methoda is located will be suspended, serviceb. methodb starts a new transaction and waits for serviceb. after the methodb transaction is completed, it continues to execute. It differs from propagation_required in transaction rollback. Because serviceb. methodb is a new transaction, it exists.
Two different transactions. If serviceb. methodb has been submitted, servicea. methoda fails to roll back, And serviceb. methodb will not roll back. If serviceb. methodb fails to roll back, the exception it throws is caught by servicea. methoda, And the servicea. methoda transaction can still be committed.
5: propagation_not_supported
Transactions are currently not supported. For example, servicea. the transaction level of methoda is propagation_required, and serviceb. the transaction level of methodb is propagation_not_supported. in methodb, servicea. the methoda transaction is suspended, and it is finished in a non-transaction state, and then continues servicea. methoda transactions.
6: propagation_never
Cannot run in transactions. Assume that the transaction level of servicea. methoda is propagation_required, and that of serviceb. methodb is propagation_never, then serviceb. methodb throws an exception.
7: propagation_nested
The key to understanding nested is savepoint. The difference between it and propagation_requires_new is that propagation_requires_new starts another transaction and will be independent from its parent transaction, while the nested transaction and its parent transaction are dependent on each other, its commit must be committed together with its parent transaction. That is to say, if the parent transaction is finally rolled back, it will also be rolled back.
The advantage of the nested transaction is that it has a savepoint.
[Java]
Class servicea {
/*
* Set the transaction property to propagation_required.
*/
Void methoda (){
Try {
// Savepoint
Serviceb. methodb (); // propagation_nested level
} Catch (exception e ){
// Execute other services, such as servicec. methodc ();
}
}
}
That is to say, serviceb. methodb fails to roll back, so servicea. methoda will also roll back to the savepoint. servicea. methoda can select another branch, such
Servicec. methodc, continue to execute to try to complete your own transactions. However, this transaction is not defined in the EJB standard.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.