286 CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT (Free web design)
286 CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT Built-in message servers that ship with application servers usually only allow you to tune the capacity of the message server. If you are using such a server, you need to ensure that messages are not being rejected, so observe the following values: If the message server averages over 80 percent of its capacity, then you should issue a critical alert that its capacity needs to be increased. If the message server averages over 95 percent and messages are being rejected, then you should issue a fatal alert that its capacity needs to be increased. Another consideration to evaluate is the amount of time it takes for a message to be delivered to its destination; this can be impacted by the reliability that is being assigned to the message. Reliability is a measure of how certain you need to be that your message is delivered to its recipient(s). If it is of the utmost importance that the message be delivered, then reliability is high, requiring the delivery to be acknowledged by the recipient. If the message delivery does not have to be guaranteed, such as a message containing a status update in which several messages will be sent every few seconds, then reliability is low because losing a message is not necessarily that important. Decreasing the level of reliability can help messages move through the message server faster. Finally, if you are using an advanced message server, such as IBM MQSeries or the TIBCO suite of products, as an integration tool between your application and another infrastructure, then you have entirely another beast to tune. Due to the discrepancy between message server implementations, I suggest you reference the manufacturer s tuning guide for more information. But keep in mind that the tuning goal is to move messages as quickly as possible between your application and mainframe and still satisfy reliability requirements. Transactions Java EE provides the Java Transaction API (JTA) and Java Transaction Server (JTS), which allow you to run code inside the context of a transaction. Code that runs inside a transaction behaves as follows: if the transaction succeeds, then its changes are committed to the state of objects as well as transaction-aware resources such as databases, but if the transaction fails, then the system is returned to its state before the transaction started. This property of transactions is referred to as atomicity, meaning that the transaction behaves as a single atomic unit: either it all works or the system returns to its state before the transaction started. Java EE provides explicit control over transactions or container-managed control over transactions. In Java EE 5 applications, EJB business methods can elect to participate in transactions by simply adding annotations to method headers (refer to the EJB3 specification, section 12.3.7 for additional information). The level of transaction participation can be one of the following values, specified through the TransactionAttribute annotation as one of the following TransactionAttributeTypes: MANDATORY: The method must be invoked inside a client s transaction context. REQUIRED: The method must be invoked inside a valid transaction context. If a transaction context does not currently exist, then a new one is created. REQUIRES_NEW: The method must be invoked inside a new transaction context. This method will act as its own atomic unit.
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.