1/82
2/82
Weblogic IntroductionWeblogic Introduction
3/82
AgendaAgenda
• Why use transactions?
• What capabilities does BEA WebLogic Server 6.0
provide?
• How to program?
• How to configure and monitor?
4/82
Benefit #1: Data ConsistencyBenefit #1: Data Consistency
• Ensure data integrity when accessing more than
one data store, especially in distributed
environment
• Simple model for application programmer:
AA - atomic
CC - consistent
II - isolated
DD - durable
5/82
Benefit #2: Monitoring & ManagementBenefit #2: Monitoring & Management
• A transaction is a higher-level unit of work than a
database query or an object invocation
o BEA WebLogic Server allows transactions to be given a semantic name
(“TransferFunds” or “ReserveSeat” or “CheckOut”)
o Transaction Name is reported in error messages
o Statistics subtotals categorized by Transaction Name
6/82
Benefit #3: Timeouts & Overload ProtectionBenefit #3: Timeouts & Overload Protection
• Transactions are subject to timeout
o 30 second default
• Application code (or the EJB container) can mark a
transaction “rollback only”
• In an overloaded system, BEA WebLogic Server:
o Times out requests (who waits 30+ seconds for a Web page to return?)
o Avoids wasted work on “doomed” transactions
o Eventually refuses to begin new transactions when there are too many
already running (configurable parameter)
7/82
Supported ConfigurationsSupported Configurations
• Multiple servers may participate in a distributed
transaction
o Clustered or non-clustered
o Need not be in same administrative domain
o Requires connectivity and permissions
• Clients may initiate transactions and infect multiple
servers
o Commit responsibility is handed off to a server
o Clients may not enlist resources or register synchronization callbacks
• Multiple XA resources may participate in same
transaction
o More than one coordinated by “two-phase commit” algorithm
8/82
Relationship with Other SubsystemsRelationship with Other Subsystems
• JDBC
o Recognized any JDBC driver that implements JDBC 2.0 XA extensions
o BEA provides Type 2 XA driver for Oracle 8.1.6 client
o JDBC wrapper enhances performance
• JMS
o Supports XA, can participate in JTA transactions
o All storage types: database, file, non-persistent
• EJB
o Automatically manages transactions based on EJB’s deployment
descriptor
9/82
High-Level ArchitectureHigh-Level Architecture
Transaction
Manager
XA-Capable
Resource
EJB Container
Application
JDBC
WrapperJTA
JDBC
JMS
XA
JDBC
JTA
10/82
Performance OptimizationsPerformance Optimizations
• Boxcar algorithm for multiple commit records per
I/O
• One-phase commit optimization
• Read-only branch optimization
• Dynamic resource enlistment optimization
• Piggy-back transaction propagation
• Multiple operations per coordination message
• Asynchronous, parallel coordination architecture
with retry
11/82
Programming APIsProgramming APIs
• Good news! In many cases, transactions are controlled by the EJB
Container, and an application programmer writes no code for
transactions
• The UserTransaction object provides simple begin/commit/rollback
functionality for applications that need to explicitly demarcate
transaction boundaries
• More powerful transaction objects normally used by the Application
Server and EJB Container are available to applications with complex
transactional requirements
• BEA WebLogic Server extensions for convenience and added
value
12/82
JTA InterfacesJTA Interfaces
• UserTransaction
o Basic methods to begin, commit, rollback transactions and get/set status
• TransactionManager
o Adds suspend, resume, get thread’s current Transaction object
• Transaction
o Represents on transaction, controls enlistment and synchronization
• Synchronization
o Callback interface for before/after completion notification
• XAResource
• Xid
• Various exceptions and status codes
13/82
BEA WebLogic Server ExtensionsBEA WebLogic Server Extensions
• weblogic.transaction.TxHelper
o Static methods to get Transaction, UserTransaction, and
TransactionManager objects
• weblogic.transaction.Transaction
o Get/set transaction name, transaction properties
o Get/set rollback reason
o Get timeout information
o Get Xid
• weblogic.transaction.TransactionManager
o XA resource registration
o Get transaction object by Xid
o Force suspend/resume (without XA calls)
14/82
Configuration Parameters (Per Domain)Configuration Parameters (Per Domain)
• Transaction Timeout Seconds
o Default number of seconds for transaction timeout, unless overridden
by API call or EJB container
• Abandon Timeout Seconds
o After X number of seconds, stop trying to resolve branch(es) of a
committed transaction and log an error
o Should never happen unless resource dies during commit processing
and does not come back
• Forget Heuristics
o When resource reports a heuristic completion, log an error message
and then tell resource to “forget”about that transaction
15/82
Configuration Parameters (Per Domain)Configuration Parameters (Per Domain)
• Before Completion Iteration Limit
o Maximum number of times a server will iterate through registered
Synchronization objects for the same transaction
o Prevents infinite loops when one Synchronization callback causes another
Synchronization object registration
• Max Transactions
o Maximum number of transactions that can be simultaneously active on a
server
• Max Unique Name Statistics
o Maximum number of transaction names remembered for categorizing
statistic subtotals
16/82
Configuration OptionsConfiguration Options
17/82
Configuration Parameters (Per Server)Configuration Parameters (Per Server)
• Transaction Log File Prefix
o Each server that coordinates a two-phase commit transaction writes to
the transaction log at commit time and reads the transaction log
during crash recovery
o A transaction log is stored in multiple files
• Space is reclaimed automatically
• Never delete these files
o Default location is server’s current directory
o Highly reliable file system is recommended (RAID, etc.)
o File naming convention:
Prefix + ServerName + 9999 + “.tlog” (9999 = unique number)
18/82
Configuration Parameters (JDBC)Configuration Parameters (JDBC)
• Transaction branches
o Connection pool name determines transaction branch qualifier
o Different pool names cause separate branches, even if connected to
same database
o Databases typically provide lock isolation between branches, shared
locks within a branch
o Benefits of multiple branches:
• Lock isolation protects independently developed components from
unexpected cross-interference
o Drawbacks of multiple branches:
• Lock conflicts can cause deadlock/timeout
• More overhead in transaction coordination, more XA calls
19/82
Configuration Parameters (JDBC)Configuration Parameters (JDBC)
• JDBCTxDataSource wrapper for non-XA database
drivers
o If EnableTwoPhaseCommit=“false” (the default) and a non-XA JDBC driver
is supplied, commit() will fail unless this is the only transaction participant
o If EnableTwoPhaseCommit=“true” a non-XA JDBC driver may participate
in a transaction with multiple participants, however there is a risk that the
non-XA driver might fail at commit time
• This is reported as a heuristic rollback exception
20/82
MonitoringMonitoring
• Counters
o Overall
o Subtotal by XAResource
o Subtotal by Transaction name
• Specific transactions
o List transactions more than XX seconds old
o “Old” transactions are the most interesting ones
21/82
Monitoring SummaryMonitoring Summary
22/82
Monitoring Stats by NameMonitoring Stats by Name
23/82
Monitoring Stats by ResourceMonitoring Stats by Resource
24/82
Monitoring Individual TransactionsMonitoring Individual Transactions
25/82
Coming AttractionsComing Attractions
• Ongoing integration testing and cooperation with
XA resource providers
• Support for transaction export/import to/from
external systems via interposed gateway
architecture
• Additional internal enhancements for reliability,
overload tolerance, and performance
• Additional management, monitoring, statistics
26/82
ThankThank You !!!You !!!
For More Information click below link:
Follow Us on:
http://vibranttechnologies.co.in/weblogic-classes-in-mumbai.html

Weblogic - overview of application server

  • 1.
  • 2.
  • 3.
    3/82 AgendaAgenda • Why usetransactions? • What capabilities does BEA WebLogic Server 6.0 provide? • How to program? • How to configure and monitor?
  • 4.
    4/82 Benefit #1: DataConsistencyBenefit #1: Data Consistency • Ensure data integrity when accessing more than one data store, especially in distributed environment • Simple model for application programmer: AA - atomic CC - consistent II - isolated DD - durable
  • 5.
    5/82 Benefit #2: Monitoring& ManagementBenefit #2: Monitoring & Management • A transaction is a higher-level unit of work than a database query or an object invocation o BEA WebLogic Server allows transactions to be given a semantic name (“TransferFunds” or “ReserveSeat” or “CheckOut”) o Transaction Name is reported in error messages o Statistics subtotals categorized by Transaction Name
  • 6.
    6/82 Benefit #3: Timeouts& Overload ProtectionBenefit #3: Timeouts & Overload Protection • Transactions are subject to timeout o 30 second default • Application code (or the EJB container) can mark a transaction “rollback only” • In an overloaded system, BEA WebLogic Server: o Times out requests (who waits 30+ seconds for a Web page to return?) o Avoids wasted work on “doomed” transactions o Eventually refuses to begin new transactions when there are too many already running (configurable parameter)
  • 7.
    7/82 Supported ConfigurationsSupported Configurations •Multiple servers may participate in a distributed transaction o Clustered or non-clustered o Need not be in same administrative domain o Requires connectivity and permissions • Clients may initiate transactions and infect multiple servers o Commit responsibility is handed off to a server o Clients may not enlist resources or register synchronization callbacks • Multiple XA resources may participate in same transaction o More than one coordinated by “two-phase commit” algorithm
  • 8.
    8/82 Relationship with OtherSubsystemsRelationship with Other Subsystems • JDBC o Recognized any JDBC driver that implements JDBC 2.0 XA extensions o BEA provides Type 2 XA driver for Oracle 8.1.6 client o JDBC wrapper enhances performance • JMS o Supports XA, can participate in JTA transactions o All storage types: database, file, non-persistent • EJB o Automatically manages transactions based on EJB’s deployment descriptor
  • 9.
  • 10.
    10/82 Performance OptimizationsPerformance Optimizations •Boxcar algorithm for multiple commit records per I/O • One-phase commit optimization • Read-only branch optimization • Dynamic resource enlistment optimization • Piggy-back transaction propagation • Multiple operations per coordination message • Asynchronous, parallel coordination architecture with retry
  • 11.
    11/82 Programming APIsProgramming APIs •Good news! In many cases, transactions are controlled by the EJB Container, and an application programmer writes no code for transactions • The UserTransaction object provides simple begin/commit/rollback functionality for applications that need to explicitly demarcate transaction boundaries • More powerful transaction objects normally used by the Application Server and EJB Container are available to applications with complex transactional requirements • BEA WebLogic Server extensions for convenience and added value
  • 12.
    12/82 JTA InterfacesJTA Interfaces •UserTransaction o Basic methods to begin, commit, rollback transactions and get/set status • TransactionManager o Adds suspend, resume, get thread’s current Transaction object • Transaction o Represents on transaction, controls enlistment and synchronization • Synchronization o Callback interface for before/after completion notification • XAResource • Xid • Various exceptions and status codes
  • 13.
    13/82 BEA WebLogic ServerExtensionsBEA WebLogic Server Extensions • weblogic.transaction.TxHelper o Static methods to get Transaction, UserTransaction, and TransactionManager objects • weblogic.transaction.Transaction o Get/set transaction name, transaction properties o Get/set rollback reason o Get timeout information o Get Xid • weblogic.transaction.TransactionManager o XA resource registration o Get transaction object by Xid o Force suspend/resume (without XA calls)
  • 14.
    14/82 Configuration Parameters (PerDomain)Configuration Parameters (Per Domain) • Transaction Timeout Seconds o Default number of seconds for transaction timeout, unless overridden by API call or EJB container • Abandon Timeout Seconds o After X number of seconds, stop trying to resolve branch(es) of a committed transaction and log an error o Should never happen unless resource dies during commit processing and does not come back • Forget Heuristics o When resource reports a heuristic completion, log an error message and then tell resource to “forget”about that transaction
  • 15.
    15/82 Configuration Parameters (PerDomain)Configuration Parameters (Per Domain) • Before Completion Iteration Limit o Maximum number of times a server will iterate through registered Synchronization objects for the same transaction o Prevents infinite loops when one Synchronization callback causes another Synchronization object registration • Max Transactions o Maximum number of transactions that can be simultaneously active on a server • Max Unique Name Statistics o Maximum number of transaction names remembered for categorizing statistic subtotals
  • 16.
  • 17.
    17/82 Configuration Parameters (PerServer)Configuration Parameters (Per Server) • Transaction Log File Prefix o Each server that coordinates a two-phase commit transaction writes to the transaction log at commit time and reads the transaction log during crash recovery o A transaction log is stored in multiple files • Space is reclaimed automatically • Never delete these files o Default location is server’s current directory o Highly reliable file system is recommended (RAID, etc.) o File naming convention: Prefix + ServerName + 9999 + “.tlog” (9999 = unique number)
  • 18.
    18/82 Configuration Parameters (JDBC)ConfigurationParameters (JDBC) • Transaction branches o Connection pool name determines transaction branch qualifier o Different pool names cause separate branches, even if connected to same database o Databases typically provide lock isolation between branches, shared locks within a branch o Benefits of multiple branches: • Lock isolation protects independently developed components from unexpected cross-interference o Drawbacks of multiple branches: • Lock conflicts can cause deadlock/timeout • More overhead in transaction coordination, more XA calls
  • 19.
    19/82 Configuration Parameters (JDBC)ConfigurationParameters (JDBC) • JDBCTxDataSource wrapper for non-XA database drivers o If EnableTwoPhaseCommit=“false” (the default) and a non-XA JDBC driver is supplied, commit() will fail unless this is the only transaction participant o If EnableTwoPhaseCommit=“true” a non-XA JDBC driver may participate in a transaction with multiple participants, however there is a risk that the non-XA driver might fail at commit time • This is reported as a heuristic rollback exception
  • 20.
    20/82 MonitoringMonitoring • Counters o Overall oSubtotal by XAResource o Subtotal by Transaction name • Specific transactions o List transactions more than XX seconds old o “Old” transactions are the most interesting ones
  • 21.
  • 22.
    22/82 Monitoring Stats byNameMonitoring Stats by Name
  • 23.
    23/82 Monitoring Stats byResourceMonitoring Stats by Resource
  • 24.
  • 25.
    25/82 Coming AttractionsComing Attractions •Ongoing integration testing and cooperation with XA resource providers • Support for transaction export/import to/from external systems via interposed gateway architecture • Additional internal enhancements for reliability, overload tolerance, and performance • Additional management, monitoring, statistics
  • 26.
    26/82 ThankThank You !!!You!!! For More Information click below link: Follow Us on: http://vibranttechnologies.co.in/weblogic-classes-in-mumbai.html