Exercise 1

Question 11 :

Which of the following attributes in the Monitoring tab for a JDBC connection pool in the Administrative console tell us how many clients are currently waiting for a connection?


A). Waiters high
B). Waiters
C). Connections high
D). Clients
E). Wait seconds high
Answer : Option B

Explanation :

JDBC subsystem resources can also be monitored via the Administration Console. The Monitoring tab for a JDBC connection pool allows you to access a table listing statistics for the instances of that pool. These attributes provide important information for managing client database access. 
The Waiters High field indicates the highest number of clients waiting for a connection at one time. The Waiters field tells you how many clients are currently waiting for a connection. The Connections High field indicates the highest number of connections that have occurred at one time. The Wait Seconds High field tells you the longest duration a client has had to wait for a database connection. These attributes allow you to gauge the effectiveness of the current configuration in responding to client requests.


Question 12 :

The MaxPostTimeSecs attribute set in the Administration console under Servers or virtual hosts section corresponds to which of the following?


A). The amount of time that WebLogic Server waits between receiving chunks of data in an HTTP POST.
B). The total amount of time that WebLogic Server spends receiving HTTP POST data.
C). The time spent by WebLogic server to post data to other servers in the cluster.
D). The number of bytes of data received in a POST from a single request.
Answer : Option B

Explanation :

Web servers may face denial-of-service attacks, which is usually carried out by sending huge amounts of data in an HTTP POST method. You can set three attributes in WebLogic Server that help prevent this type of attack. These attributes are set in the console, under Servers or virtual hosts. You can limit the amount of time that WebLogic Server waits between receiving chunks of data in an HTTP POST by setting the attribute PostTimeoutSecs. 
The MaxPostTimeSecs attribute limits the total amount of time that WebLogic Server spends receiving post data. If this limit is triggered, a PostTimeoutException is thrown and a message is sent to the server log. MaxPostSize attribute limits the number of bytes of data received in a POST from a single request. If this limit is triggered, a MaxPostSizeExceeded exception is thrown and a message is sent to the server log.


Question 13 :

A client wants to preserve the reference to the EJBhome object of an enterprise bean instance and use it later. Which of the following can be serialized for this purpose ?


A). home
B). Handle
C). homeHandle
D). EJBhomeHandle
E). homeObject
Answer : Option C

Explanation :

Once a client has obtained the EJBhome object for an EJB instance, it can create a reference to the home object by calling gethomeHandle(). gethomeHandle() returns a homeHandle object, which can be used to obtain the home interface to the same EJB instance at a later time. 
A client can pass the homeHandle object as arguments to another client, and the receiving client can use the handle to obtain a reference to the same EJBhome object. Clients can also serialize the homeHandle and store it in a file for later use. The homeHandle interface has only one method getEJBhome(), which returns the EJBhome reference.


Question 14 :

Match the EJB functions given below with the functionality equivalent in SQL
A.) ejbStore() 
1.) INSERT
B.) ejbLoad() 
2.) UPDATE
C.) ejbCreate() 
3.) SELECT


A). A->1, B->2, C->3
B). A->2, B->1, C->3
C). A->3, B->2, C->1
D). A->1, B->3, C->2
E). A->2, B->3, C->1
F). A->3, B->1, C->2
Answer : Option E

Explanation :

When the create() method on a home interface is invoked, the container delegates the create() method call to the bean instance's matching ejbCreate() method. The ejbCreate() methods are used to initialize the instance state before record is inserted into the database. The ejbCreate() method is analogous to INSERT. The ejbStore() method is invoked just before the container the container is about to write the bean container-managed fields to the database. It is analogous to the UPDATE . The ejbLoad() is invoked just after the container has refreshed the bean container-managed files with its state from the database. It is analogous to the SELECT. Thus choice E is correct and others are not.


Question 15 :

A client invokes a method on a stateful session bean instance deployed in the WebLogic Server. While the method execution is in progress another method call arrives on the server. What will be the result?


A). RemoteException is thrown if the value of concurrency-strategy property is false
B). EJBException is thrown if the value of concurrency-strategy property is false
C). The EJB container blocks the concurrent method call and allows it to proceed when the previous call has completed if the value of allow-concurrent-calls is true
D). In all cases, RemoteException is thrown
Answer : Option C

Explanation :

By default, simultaneous access to a stateful session EJB results in a RemoteException. However, you can set the allow-concurrent-calls option in the WebLogic EJB deployment descriptor to specify that a stateful session bean instance will allow concurrent method calls. This access restriction on stateful session EJBs applies whether the EJB client is remote or internal to WebLogic Server. By default, allows-concurrent-calls is false. However, when this value is set to true, the EJB container blocks the concurrent method call and allows it to proceed when the previous call has completed. 
The concurrency-strategy element determines ejbLoad() and ejbStore() behavior for entity EJB instances.