You are on page 1of 83

Programming Business Logic using EJB

1. WORA stands for _________________. [0.5]

a) Write Once Read Always c) Work Once Run Afterwards.

b) Write Once Run Anywhere d) Wrong Out Read Again.

2. Which of the following is not an advantage of the multi-tier application [1.0]


model.

a) Providing user interaction, c) Platform independence


using client-side applications.

b) Programming business logic d) Relying on backend services

3. Which of the following statements is not true regarding EJB. [1.5]

a) It is container dependent. c) It collects all the common


elements present during the
development of server-side
processes and applications.

b) It is server-side component d) Transaction oriented


architecture. components are written in
Java.

4. The client side is more complex than the server side [0.5]

a) True b) False

5. A ______________________ in EJB is an object that is deployed on [0.5]


any EJB server.

a) Component c) Chunk

b) Container d) Logic
6. Which of the following statements is false with respect to a distributed [1.5]
application.

a) Processing is distributed c) It allows for a more


across multiple networked accessible business system.
computers.

b) It is based on a two-tier d) The user interface is on one


application development network while the business
rules and database is on
another network

7. ___________________ is not a model for developing distributed [1.0]


applications.

a) DCOM c) RMI

b) COM d) CORBA

8. Generally, ________________________ objects do not implement any [0.5]


interfaces.

a) remote c) public

b) distributed d) local

9. Which of the following statements does not describe a component. [2.0]

a) It is an object. d) It can be described as a


chunk of logic.

b) Performs a set of functions. e) It has an independent


existence of its own.

c) Can consist of one or more


classes.
10. Server side component architecture manages the components during [1.0]
____________.

a) Compilation c) logic building

b) Development d) run time

11. Which of the following lines pertaining to local objects are true. [2.0]

a) They are created in a totally c) References are obtained


different JVM. directly.

b) They are accessed using d) They always implement a


interfaces. remote interface.

12. ______________________________________ enhances reusability [1.0]


and portability.

a) Client side component c) Server-side component


architecture. architecture.

b) JVM d) Remote objects.

13. The J2EE platform does not contain middleware services. [0.5]

a) True b) False

14. Match the following: [2.5]

1. EJB a) It acts as a relational database


2. JDBC b) It allows asynchronous communication
3. JTA c) It is a component technology
4. JMS d) It is used for reliable transaction support

a) 1 – a, 2 – b, 3 – c, 4 – d c) 1 – d, 2 – b, 3 – a, 4 – c

b) 1 – c, 2 – a, 3 – d, 4 – b d) 1 – d, 2 – c, 3 – b, 4 – a
15. Multiple connections from the client are taken care of by the [0.5]
__________________.

a) Remote reference layer c) Skeleton layer

b) Stub layer d) Transport layer

16. The ______________ is an implementation of CORBA. [1.0]

a) Enterprise Java Beans c) Java Transaction API

b) Java Messaging Service d) Java IDL

17. Socket communication is ideal for exchanging files or small amounts of [0.5]
data.

a) True b) False

18. The RMI defines the difference between _______________ and [1.0]
_______________ objects.

a) public/global c) remote/local

b) distributed/concentrated d) random/definite

19. The ______________________________ supports communication [1.5]


between the stub and skeleton.

a) remote reference layer c) transport layer

b) stub layer d) Architecture

20. Method calls by the client, to the remote object leads to an invocation [1.5]
of a method on the _________which in turn passes control to the
_________________ layer.

a) transport layer/top c) remote reference


layer/lowermost
b) stub/underlying d) transport layer/next

21. Providing a user-defined interface can change the implementation of [2.0]


the transport layer.

a) True b) False

22. A _____________ must be acquired to the remote object, before a [1.0]


client can invoke a method on that object.

a) tag c) connection

b) reference d) loop

23. Arrange the Events given below in the correct sequence. [2.5]
1)The skeleton contacts the remote registry.
2)The object method is called.
3)Invocation of the stub.
4)Result is passed to the client object.
Forwarding the request the reference layer.

a) 2 – 5 – 3 – 4 – 1 c) 3 – 5 – 1 – 2 – 4

b) 1 – 2 – 3 – 4 – 5 d) 4 – 1 – 5 – 2 – 3

24. All distributed systems consist of _________________ and [1.0]


___________________.

a) remote objects/random objects c) stubs/skeletons

b) transport layers/reference d) JTA/JMS


layers

25. The _______________________ is responsible for unicast point-to- [0.5]


point invocation.

a) remote reference layer c) skeleton layer

b) stub layer d) transport layer


26. At present, ____________ is used by RMI to communicate between [1.5]
the ____________ transport layer and the _________________
transport layer.

a) IPX/PX, client, user c) Remote access, remote,


network

b) NetBEUI, proxy, host d) TCP/IP, client, server

27. The remote registry is stored on the client. [0.5]

a) True b) False

28. Which of the following classes belong to the java.rmi package. [1.0]

a) MarshalledObject c) Naming

b) RegistryHandler d) Skeleton

29. The ___________________ does not have any methods. [1.0]

a) MarshalledObject d) Remote Interface

b) RMISecurityManager e) Naming

c) RegistryHandler

30. Arrange the order in which a remote object will be created and [2.0]
registered.

1.Create the stub and skeleton classes


2.Create the Remote interface
3.Create and register the Remote object
4.Create a class that implements the Remote interface.
5.Copy the Remote interface and stub file to the client.
a) 1 – 2 – 3 – 4 – 5 c) 5 – 1 – 3 – 4 – 2

b) 3 – 2 – 1 – 5 – 4 d) 2 – 4 – 1 – 5 – 3

31. The interfaces and classes of the __________________ package are [1.0]
used to handle and register remote objects by name.

a) java.rmi.server package c) java.rmi.package

b) java.rmi.registry package d) java.rmi.activation package

32. Remote objects are always referenced through an interface. [0.5]

a) True b) False

33. The client object can call all the methods of the remote object. Do you [1.0]
agree with this statement?

a) Agree b) Disagree

34. Every method of the remote interface must throw a [0.5]


______________________.

a) getData() c) getDataNum()

b) RemoteException d) interface

35. The statements given below define the implementation of the Remote [2.0]
Interface. Which of these is not true.

a) Classes that implement the c) The implementation class


remote interface generally also implements all the
extend the methods present in the
‘UnicastRemoteObject’ class. remote interface.

b) The implementation class d) The implementation class


does not require a has a main() function.
constructor.
36. How many errors are there in the following code snippet. [2.5]

import java.rmi.;

public interface MyEx extends Remote


{
String getDataNum();
String getData(int a) throws RemoteException
}

a) None c) Five

b) Four d) Two

37. Which of the following lines of code will be required to register the class ‘Myex’, where [
the name of the host machine is stored in ‘hostName’ and the name used by the client to
call the remote object is ‘myobj’.

a) Myex instance = new Myex(); c) Myex = new Myex();


Naming.rebind(“//”+hostName+”/myobj”, Naming.(“hostName”, instance));
instance));

b) DistributedExImpl instance = new d) Myex instance = new Myex;


DistributedExImpl(); Naming.rebind(“//”+hostName+”/myobj”
Naming.rebind(“//”+hostName+” , instance)
/DistributedExample”, instance));

38. The _______________ compiler is used to register the class that [1.0]
implements the remote interface, with the remote registry.

a) rmi c) rmic

b) class d) java

39. When the compiler is executed for the ‘Myex.class’ program, then the [1.5]
following files are generated. (Choose the correct answer/s).

a) Myex.java c) Myex.class

b) Myex_Stub.class d) Myex_Skel.class
40. The command required to start the RMI registry is [1.5]
____________________

a) start rmiregistry c) execute rmiregistry

b) rmiregistry d) begin rmiregistry

41. For listening to incoming requests the RMI registry uses port [1.0]
___________.

a) 1024 c) 1099

b) 65535 d) 1020

42. The client is able to directly code the container. Do you agree with this [0.5]
statement?

a) Agree b) Disagree

43. Connection pooling and security management are examples of [0.5]


_____________________.

a) Multi-tier applications. c) Components.

b) Application servers d) Middleware.

44. The ______________________ meets the low-level run time [1.0]


execution environment required by EJB applications.

a) Container provider c) Server provider

b) Bean provider d) Deployer

45. Match the following. [2.5]

1.Bean provider a) It takes prewritten components


and deploys them
2.Application assembler b) It provides reusable components
3.Deployer c) It is similar to the container provider
4.Server provider d) It is used for putting the components
together

a) 1 – a, 2 – b, 3 – c, 4 – d c) 1 – d, 2 – c, 3 – b, 4 – a

b) 1 – b, 2 – d, 3 – a, 4 – c d) 1 – c, 2 – a, 3 – d, 4 – b

46. The EJB ___________ consists of the EJB ____________, which in [1.5]
turn contains the EJB ___________.

a) components/container/server c) container/server/components

b) server/container/components d) components/server/container

47. The EJB architecture consists of the following tiers. [1.5]

a) Client d) Database

b) Container e) EJB server

Home interface

48. The bean accesses the database using ______________. [0.5]

a) ODBC c) JDBC

b) MS-SQL d) server

49. Interaction with the bean by the client is done using the [1.0]
_____________ interface and the ___________ interface.

a) home/remote c) user/EJB

b) database/server d) random/client

50. The ___________________ acts as a buffer between the bean and [1.0]
the outside world.
a) Component c) Container

b) EJB server d) Client

51. Which of the following statement is false with respect to the EJB [2.0]
container.

a) It consists of a representation c) The bean is aware of the


of the bean requested by the methods used by the
client. container to implement the
services.

b) It provides services to the d) It provides support to


bean. manage and keep track of
beans.

52. The EJB object and EJB home for a bean are managed by the [0.5]
container.

a) True b) False

53. Which of the specifications is not available in EJB1.1? [2.5]

a) Session Beans c) Java Messaging Service

b) Entity Beans d) Message Driven Bean


(MDB)

54. The Life cycle of EJB is defined by__________________. [2.5]

a) Remote Interface c) Implemented by User

b) Home Interface d) None of the above

55. Match the following directory services (2.5) [2.5]

a) LDAP 1. SUN OS
b) NDS 2. Netscape
c) NIS 3.Novell

a) a-2 ,b-3 ,c-1 b) a-2 ,b-1 ,c-3

b) a-1 ,b-2 ,c-3 d) a-3 ,b-1 ,c-2

56. In JNDI, binding is an association of a ________________ with a/an [2.5]


_____________.

a) class/library c) client/server

b) name/object d) file/directory

57. Marshalling is the process that converts arguments and return values [2.5]
into ___________________ that can be sent over the network.

a) data c) stream of bytes

b) bits of information d) bits and bytes.

58. Stub file resides on the server. State whether the statement is true or [2.5]
false.

a) True b) False

59. Depending on the environment, the deployer adapts the [1.5]


_________________, _________________ and _______________ to
that environment.

a) beans/server/container c) server/component/database
interface/middleware/hardwar
e
b) client/object/component d)

60. The container along with all its interfaces resides in the [0.5]
___________________.

a) client c) beans
b) object d) server

61. Which of the following is not an example of EJB server/container. [1.0]

a) IBM’s Websphere d) BEA’s Weblogic

b) Jakarta Tomcat’s Jboss e) Oracle’s Oracle Application


Server

c) SQL server

62. Assembling of the deployable server side components, at the [1.0]


customers end is done by the ________________.

a) application assembler c) client

b) client assembler d) server

63. Which of the following is not a function of the application server [1.5]

a) Mapping components which c) Providing a user interface


are different from each other

b) Providing an environment in d) Making sure that the


which the enterprise bean component is like a given
can run entity

64. The EJB deployer is unaware of the operational environments. [0.5]

a) True b) False

65. Match the following. [2.0]

1.Consistency a) changes stored permanently


2.Isolation b) changes are not saved
3.Atomicity c) prevents viewing till transaction is
committed
4.Durability d) one logical unit
a) 1 – b, 2 – c, 3 – d, 4 – a c) 1 – a, 2 – b, 3 – d, 4 – c

b) 1 – d, 2 – c, 3 – a, 4 – b d) 1 – c, 2 – a, 3 – b, 4 – d

66. As of now, the terms container and EJB server in EJB can be used [1.5]
inter-changeably. Do you agree with this statement?

a) Agree b) Disagree

67. Adaptation of the access level of beans to fit into a particular system is [1.0]
done by the system administrator.

a) True b) False

68. The management tools used by the EJB server and container are 1.0
controlled by the _________________.

a) EJB deployer c) EJB container

b) EJB server d) EJB administrator

69. Identify the services that the container or the server fails to provide [2.0]

a) Security support c) Persistence support

b) Writing of code d) Management of multiple


instances.

70. The properties that characterize transactions are known as ACID [0.5]
properties.

a) True b) False

71. The _______________ notification at given at the start of the [1.0]


transaction, signals the start of the transaction.

a) Start c) Initial
b) Begin d) First

72. Can a transactional context be propagated from client? Comment. [2.0]

a) True b) False

73. Which transaction attribute cannot be set while deployment [2.5]

a) TX_NOT_SUPPORTED d) TX_NOT_REQUIRED

b) TX_SUPPORTS e) TX_REQUIRES_NEW

c) TX_REQUIRED

74. The person deploying the bean specifies the ________________ for [1.5]
that bean for better __________________.

a) ACID/transaction c) State of the


object/consistency

b) Start/durability d) ACL’s/security

75. Repeated creation of an object whenever it is required is persistence. [1.0]

a) True b) False

76. Constant storage can be done on a file. [0.5]

a) True b) False

77. For efficient management of multiple instances, the server performs a [2.0]
variety of tasks. Which of the tasks mentioned below, is not one of
them.
a) Instance passivation c) Message pooling

b) Instance pooling d) Database connection


pooling.

78. The Life cycle of EJB is defined by: [2.0]

a) Remote Interface c) Implemented by User

b) Home Interface d) None of the above

79. The specifications set by EJB need not match with those of the [0.5]
component interface.

a) True b) False

80. When the client calls a bean, it can in turn call another bean. Do you [1.0]
agree with this statement?

a) Agree b) Disagree

81. What do A and B represent in the diagrammatic representation given [1.5]


below; (1.5)

Session Bean

a) A – Stateful Bean, B – c) A – BMP, B – CMP


Stateless Bean

b) A – Entity Bean, B – Enterprise d) A – JavaBean, B –


Bean Enterprise Java Bean

82. A session bean being used by a client can also be used by another [0.5]
client.
a) True b) False

83. The instantiation of a session bean is done by the [1.5]


____________________ while the management of the lifetime of the
bean is done by the ___________________________.

a) EJB server/container c) Component/client

b) Container/EJB server d) Client/component

84. Once the client ceases to exist, the session bean is also destroyed. [0.5]
State True or False.

a) Yes c) No

85. Suppose in a garment shop, a request is made for all the colors [1.5]
available in a particular garment along with the all the sizes and their
respective prices, then which session bean will be used to handle such
processes?

a) Stateful session bean b) Stateless session bean

86. Stateless session beans are also known as [1.0]


_________________________.

a) Stateful session beans c) Anonymous method


providers

b) Container d) Know method providers

87. Measuring in terms of throughput and resource consumption, [2.0]


____________________ beans provide the highest performance.

a) Stateless session beans c) Entity beans

b) Stateful session beans


88. When multiple clients try to access the same bean, then the developer [1.5]
needs to take care of instantiating an equal number of components for
servicing the multiple clients.

a) True b) False

89. Which of the beans cannot be pooled? [2.0]

a) Stateful session beans c) CMP

b) State less session beans d) BMP

90. In J2EE Design Business process is represented as [2.0]


________________ and Business data is represented as
__________________.

a) Session beans / Entity c) CMP/BMP


beans

b) Stateless beans/stateful d) Transaction/process


beans

91. Which of the following statement does not represent an entity bean. [1.5]

a) They are shared by multiple c) An entire chunk of data can


clients be read once into an entity
bean.

b) They are modeled on real d) It cannot be manipulated.


world objects.

92. The life of an entity bean is as long as the client session. [0.5]

a) True b) False

93. If a ______________is being used then all the operations need to be [0.5]
written by the developer to a persistent API.
a) Bean-Managed persistent b) Container-Managed
entity bean. persistent entity bean.

94. _____________________ beans have a higher level of reuse. [1.0]

a) Session beans c) Stateful session beans

b) Entity beans d) Stateless session beans

95. What is known as instance pooling. [1.5]

a) The instantiation, destroying b) If the bean is not required


and reuse of a bean by the after use, then the container
EJB container. destroys it.

b) If a requested bean has to be d) All of the above.


created, then the container
does the instantiation.

96. A ____________ is a group of operations, which appear as one large [1.0]


operation during execution.

a) Transaction c) Task

b) State d) Process

97. At the time of creation, beans are written as ______________ [1.0]


components, while during deployment they are ___________
components.

a) Distributed/individual c) Networked/single

b) Separate/distributed d) Whole/networked.

98. The bean class is different from a Java class. [0.5]

a) True b) False
99. The implementation of a session bean is the same as an entity bean. [1.5]
Do you agree with this statement? Select the correct reason to
support your answer.

a) Yes – because both are types c) Yes – because the


of enterprise javabeans. implementation details of the
components are present in
the bean class

b) No – because entity beans


relate to persistent objects,
whereas session beans
contain business-process
related logic.

100. The bean class has to portray a set of methods specific to beans, [1.5]
when the ________________________ as per the EJB specification
are implemented.

a) Components c) Interfaces

b) Containers d) Objects

101. The statement javax.ejb.Enterprisebean extends [1.5]


java.io.Serializable signifies:-

a) The bean class is confirmed. c) None of the above

b) The enterprise beans can d) Both a and b


share all the properties of the
serializable objects.

102. What takes place when a client invokes a method on a bean? [1.5]

a) The bean is directly invoked. c) The EJB container delegates


the client request to the bean
instance.

b) The EJB container intercepts d) The EJB container delegates


the call by the client. the client request to the bean
instance.

103. Which of the following is not a management function performed by an [1.0]


EJB container.

a) Container logic c) Bean instance logic

b) Security logic d) Transaction logic

104. Which of the following statements is not true regarding an EJB object. [2.0]

a) The EJB container manifests c) This is the original object


itself as a single network- aware of networking,
aware object. transactions and security.

b) The network-aware object is d) This object performs the


also called the EJB object. intermediate logic necessary
for the EJB container to
service the method calls.

105. The interface, which duplicates the methods exposed by the bean [1.0]
class, is called the _______________.

a) Remote interface c) External interface

b) Home interface d) Internal interface

106. Which of the following functions does the remote interface perform? [1.5]

a) Persistence c) Security

b) Business methods d) Concurrency

107. All the remote interface types extend the [1.0]


___________________________________ interface.
a) javax.ejb.EJBHome c) javax.ejb.EnterpriseBean

b) javax.ejb.EJBObject d) java.rmi.Remote

108. Which of the following is not a method of the EJB object. [1.5]

a) getEJBHome() c) isidentical()

b) remove() d) getEJBMetData()

109. The _____________________ method is used to delete an entity [0.5]


bean from the persistent store.

a) delete() c) getHandle()

b) remove() d) erase()

110. The client code which invokes methods on the EJB object is in the [1.0]
form of:

a) JSP c) . exe file

b) Enterprise bean d) All the options given

c) Applets

111. The client is unaware of the physical location of a remote object in [0.5]
EJB. Do you agree with this statement?

a) Agree b) Disagree

112. The initialization of an EJB object depends on the [1.0]


____________________.

a) Home Object c) Container

b) Remote Object d) Client


113. Only entity beans can be destroyed by passing the [1.0]
_________________________.

a) EJBMetadata object c) Secondary key

b) Primary key d) EJB handle

114. Which of the following is not the responsibility of the EJB home object. [1.5]

a) Make a copy of every c) Instantiate an EJB object.


method exposed by the
bean class.

b) Remove the EJB objects. d) Search for an existing EJB


object.

115. The deployment descriptor is essentially a file. [0.5]

a) True b) False

116. Choose the correct answer/s from below. [2.0]

The deployment descriptor contains essential information regarding


___________

a) Remote interface d) Home interface

b) EJB container e) Client

c) Classes that form the bean

117. Can a blank method be added in Home interface as per EJB 1.1 [1.0]
spec?

a) True b) False
118. Deployment properties are stored in a _______________________ [2.0]
file.

a) Java c) HTML

b) Class d) XML

119. Deployment descriptors provide persistence requirement, wherein the [2.0]


EJB container is informed whether a session bean can take care of
persistence on its own, or whether it should delegate the persistence
to the container. Do you agree with this statement?

a) Agree b) Disagree

120. Generation of the EJB object, and the home objects, and tuning the [0.5]
bean, are functions that have to be performed by the
___________________.

a) Deployer c) Container

b) Developer d) Client

121. The life of a/an __________________ is comparatively smaller than [1.0]


that of a/an _________________.

a) Entity bean/session bean b) Session bean/entity bean

122. Session beans are able to survive machine crashes. Do you agree [1.0]
with this statement? Give reasons for your answer.

a) Yes – because they are c) Yes – because they can be


enduring objects. constructed in memory from
the data in the database.

b) No – because they die along d) No – because they represent


with the surrounding business logic.
environment.
123. What are call back methods? [2.5]

a) Container calling methods of c) Methods representing


bean business logic.

b) Non-enduring methods d) Methods representing


business data.

124. ___________________________ session beans are more functional, [0.5]


as they can retain their conversational state.

a) Stateless b) Stateful

125. The methods implemented by the session beans are available to the [1.0]
clients.

a) True b) False

126. Which of the following is a callback method that the container makes [1.0]
use of.

a) setSetContext(Session c) ejbActivate()
Context ctx)

b) ejbCreate() d) ejbRemove()

127. The ejbpassivate() method is called before the bean is passivated. [0.5]

a) True b) False

128. Deployment descriptors are ______________ that describe the bean [2.5]
and some of its runtime behavior to the container.

a) jar files c) serialized classes

b) interfaces d) beans
129. The ejb-jar.xml file may or may not be present in the directory called [0.5]
META-INF.

a) False b) True

130. Session beans have a primary key. [2.0]

a) True b) False

b) d)

131. Deployment descriptors are found in the [2.5]


_________________________ package.

a) javax.ejb.DeploymentDescriptor c) javax.ejb.ControlDescriptor

b) javax.ejb.deployment d) javax.ejb.descriptor

132. The _______________________ is a gateway for the bean to interact [0.5]


with the container.

a) setSetContext(Session c) ejbActivate()
Context ctx)

b) ejbCreate() d) ejbRemove()

133. The container may not call the ejbRemove() method. Why? [1.5]

a) Because the life of the bean c) Because the bean is an


has expired. entity session bean

b) Because the bean is a d) Because of a container


stateless session bean crash.

134. Study the code given below. The method simpleint() given below is [2.0]
an example of _____________

Import java.ejb.*;
Public class sess implements SessionBean
{
public int simpelint(int pi,int rate,int tm )
{
return (pi + (pi * rate * tm / 100);
}
.....
}

a) ejbCreate() method c) ejbPassivate() method

b) business method d) ejbActivate method

135. Binding is an association of a _______________ with a/an [1.5]


______________.

a) home interface/remote c) client/server


interface

b) name/object d) client/network

136. Which of the following is not a step involved in JNDI? [2.0]

a) Specify initial context factory c) Acquire Initial context

b) Information for Service d) Connecting the bean with


provider to start up the container

137. Which of the beans cannot be pooled? [2.5]

a) Stateful session beans c) CMP

b) State less session beans d) BMP

138. The major advantage of bean pooling is that there is maximum [0.5]
utilization of time and resources.

a) True b) False
139. The client creates and destroys the bean. [0.5]

a) True b) False

140. Point out the error in the following code, assuming that a remote [2.5]
interface ‘myeg’ has already been created.
1) import javax.ejb.*;
2) import java.rmi.*;

3) public interface myeghome extends EJBHome


4) {
5) myeg create() throws RemoteException, CreateException ;
6) }

a) No errors c) Error in line 5 – class myeg


not found

b) Error in line 3 – the package d) Error in line 5 – two


javax.ejb. EJBHome needs to exceptions cannot be thrown
be extended together

141. While defining the bean class, are the following statements valid: [2.5]
………………
………………
public void ejbActivate(){}
public void ejbPassivate(){}
public void ejbRemove(){}
………………………..

a) Yes – they are valid b) No – they will generate an


error.

142. Which of the following methods of stateless session beans never have [2.5]
their callback methods invoked.

a) SetSetContext(Session d) ejbRemove()
Context ctx)

b) ejbCreate() e) ejbPassivate()
c) ejbActivate()

143. The arguments and return type for each method should be [2.0]
serializable.

a) True b) False

144. The process of swapping out a bean and saving the conversational [1.0]
state to a storage device is known as ___________.

a) Activation c) Swapping

b) Passivation d) Pooling

145. At any point of time ___________________ instance/s of stateful [1.0]


sessions beans are/is allowed in the container when there are clients
making requests.

a) no c) many

b) one d) few

146. The activated bean is always the original bean instance that was [0.5]
passivated.

a) True b) False

147. LRU stands for [1.0]

a) Last remote user c) Last recently used

b) Least recently used d) Least resource utilized

148. Once the server has been started, the client code can be executed [1.0]
from the same window.

a) True b) False
149. Arrange the activation process in the proper sequence. [2.0]
1) Serialize the bean state.
2) Conversational state is read back into memory.
3) The ejbActivate() method restores the resources of the bean.
Container reconstructs the memory state.

a) 2 – 4 – 1 – 3 c) 3 – 1 – 2 – 4

b) 1 – 2 – 3 – 4 d) 3 – 2 – 4 – 1

150. What do the following lines of code indicate: [1.5]

System.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");

System.setProperty("java.naming.provider.url",
"192.9.200.9:1099");

a) Nothing important, these lines c) Indicates the way to locate


just have to be compulsorily the client, which is 1099.
given.

b) Indicates the way to locate d) Mentions how the bean will


the server, which is 1099. interact with the container.

151. What do the following lines of code indicate? (2) [2.0]

…………
public int myvar;
…………..
public void ejbCreate(int myvar) throws CreateException
{
this.myvar = myvar;
…………….
}

a) Stateless session bean class c) The above method will


has been created. begin a conversation with
the client in a stateful
session bean.

b) Simply, a variable myvar has d) None of the above.


been declared.
152. Point out the error/s in the following code for the creation of the [2.5]
remote interface. (2.5)

1) import javax.ejb.*;
2) import java.rmi.RemoteException;

3) public interface Myrem extends EJBObject


4) {

5) public string myrem() throws RemoteException;


}

a) No errors c) Error in line 5 only

b) Error in line 1 and 5 d) Error in line 3

153. Assume that the files Myeg, Myeghome and Myegbean representing [2.5]
the remote interface, home interface and the bean class
respectively, have been created in the myeg directory. What will
the following command do:

jar cvf myeg.jar Myeg.class Myeghome.class Myegbean.class

a) Create a myeg.jar file in the c) Will give an error


META-INF directory

b) Create a myeg.jar file in the d) None of the above.


current directory

154. Assume that the files Myeg, Myeghome and Myegbean representing [2.5]
the remote interface, home interface and the bean class
respectively, have been created in the myeg directory. What will
the following command do and will this jar file work with the client
code?

jar cvf myeg.jar Myeg.* Myeghome.* Myegbean.* META-INF

a) It will create a myeg.jar file c) It will create a myeg.jar file


and will include all the .java and will include only the
files also. Yes, it will work .class files and it will work
with the client code. with the client code.
b) It will create a myeg.jar file d) It will generate an error.
and will include only the .class
files but it will not work with the
client code.

155. Assume that the files Myeg, Myeghome and Myegbean representing [2.5]
the remote interface, home interface and the bean class
respectively, have been created in the myeg directory. Will the
following command work with the client code. Give reasons for
your answer.

jar cvf myeg.jar Myeg.class Myeghome.class Myegbean.class

a) Yes it will work normally with c) No it will not work with the
the client code. client code, as the files in
the META-INF directory are
not included.

b) No it will not work with the d) None of the above.


client code, as the jar file
needs to be created in the
META-INF directory.

156. To run the client, the server ______________ [1.5]

a) Needs to be started before c) Need not be started.


we run the client.

b) Needs to be started after we d) None of the above.


run the client.

157. In order to start the server, we need to give the [1.0]


_________________________ command at the command prompt.

a) execute c) run

b) start d) start server

158. The passivation process is the opposite of the activation process. [0.5]
a) True b) False

159. If ________________________ invocation/s is/are required, then [1.0]


stateful session beans need to be used, whereas for
_____________________ method call/s the stateless session bean
has to be used.

a) a single/multiple c) one/many

b) multiple/single d) no/multiple

160. Which of the following sentences is an advantage of stateless session [1.5]


beans.

a) There are a lot of input/output c) Client-specific data needs to


bottlenecks. be given.

b) Increased congestion in the d) Pooling is simple.


network.

161. There is an increased chance of losing conversations while using [0.5]


stateless session beans.

a) True b) False

162. Data needs to be pushed to the stateful session bean for every [0.5]
method invocation.

a) True b) False

163. The conversation with the client ___________________ be lost, due [1.0]
to caching of client conversation, while using stateful session beans.

a) may c) will never

b) will always d) none of the above

164. What are the don’ts while using stateful session beans? [1.5]
a) Always keep the c) Try to use EJB products that
conversation long. persists stateful
conversations.

b) Always write the client code d) None of the above


that takes into account bean
failures.

165. The rules for the conversational state are put forward by [2.0]
______________________.

a) EJB c) The server

b) Java object serialization. d) The client

166. The ___________________________ method is used to read the [1.5]


conversational state back into the memory.

a) ejbPassivate() c) ejbCreate()

b) ejbActivate() d) ejbremove()

167. Which of the following files is not included in the .jar file. [1.5]

a) home interface c) bean class

b) remote interface d) client code

168. To be able to execute the bean, the .jar file needs to be copied to the [1.0]
______________________ directory of the server.

a) bin c) deploy

b) META-INF d) current

169. Stateful session beans tend to be specific to one scenario. Do you [2.0]
agree with this statement?
a) True b) False

170. Stateful session beans are dedicated to _____________ client/s and [2.5]
have a preset __________________ period.

a) few/time c) one/timeout

b) many/session d) none of the above

171. Stateless session beans are dedicated to one client. [2.0]

a) True b) False

172. A client is able to maintain a connection to a stateless session bean’s [2.5]


___________________________, but the
_______________________ itself is free to service requests from
anywhere.

a) container/server c) server/component

b) component/container d) EJB object/bean

173. Since the stateless session bean does not contain any [2.5]
_______________________ information, there is
_______________________ between one client and the next.

a) State/no difference c) Bean/always a similarity

b) Conversational/difference d) None of the above.

174. Stateless session beans often perform services that are fairly generic [2.0]
in nature and are reusable. Do you agree with this statement.

a) Yes b) No

175. Entity beans are called _______________________ objects. [0.5]


a) Resistant c) Persistent

b) Dominant d) None of the above

176. To be able to deploy entity beans, the EJB container has to be [1.0]
compliant with Enterprise JavaBeans version 1.0.

a) True b) False

177. Which of the following sentences differs in meaning with respect to the [2.0]
other three.

a) Entity beans model real c) The state of an entity bean is


world objects. permanently stored in the
database.

b) Persistence is expected to d) Entity beans are durable


operate with transactional
integrity.

178. In EJB, persistence can also be termed as ______________. [1.0]

a) Object serialization c) EJB object

b) Object durability d) Permanence

179. Which is not a way of making an object persistent. [1.5]

a) Object Database Management c) Object-Relational Mapping.


System

b) Relational Database d) Java Object Serialization.


Management System

180. The capturing of Java Objects in their current state for permanent [1.0]
storage is known as ______________________.

a) Object capturing c) Object Serialization.


b) Object Database Management d) Object-Relational Mapping.
System

181. In _________________________ Java objects are stored as whole [1.0]


objects.

a) Hand-craft mapping c) Object database


management

b) Java serialization d) Object-relational mapping

182. Which of the following statements is not part of the Java object [2.0]
serialization process.

a) It consists of a simple method c) This enables the developer


to marshall an object graph to pull the data over a
into a compact representation. network.

b) The serialization of a graph d) The data may be saved as a


converts it into a byte stream. stream to a storage

183. In _____________________ databases, each Java object is [0.5]


decomposed into its constituent part, which is stored separately.

a) Object c) Complex

b) Simple d) Relational

184. The process of querying stored objects using objects serialization is [1.0]
_________ and __________.

a) Cheap/simple c) Expensive/cumbersome

b) Cheap/cumbersome d) Expensive/simple

185. Either ________________ or _______________ can be used to map [1.0]


the object data to the relational database, while saving the objects.

a) JDBC, SQL/J c) Access, MS SQL


b) OOP, RDBMS d) ODBC, OOP

186. Arrange the sequence in which the object is read back from a [2.0]
relational database.

1.The object is instantiated from the Java class.


2.The data is read from the database.
3.The field of the Java class instance is populated with the data.

a) 1 – 2 – 3 c) 2 – 1 – 3

b) 3 – 2 – 1 d) 2 – 3 – 1

187. Object-Relational mapping is more sophisticated than Java [0.5]


serialization.

a) True b) False

188. The fields of an object are mapped to a relational database in [1.0]


_________ mapping.

a) Hand-craft c) Object database


management

b) Java serialization d) Object-relational

189. Sun’s JavaBlend and Object People’s TOP link are examples of a/an [1.0]
_________ product.

a) Java serialization c) Object database


management

b) Hand-craft d) Object-relational

190. Programming to a relational database is required in object database [0.5]


management.

a) True b) False
191. OQL stands for _____________. [0.5]

a) Other Query Language c) On Question loop

b) Object Query Language d) Oriented Question language

192. Which line does not describe the object database management [1.5]
system.

a) The OQL adds a layer of c) Object oriented databases


abstraction from the relational give better mapping between
database queries the entity bean and the
database.

b) A decomposed part of the d) Serializable objects can be


object forms a row in the stored in the object-oriented
relational database database.

193. Systems based on mainframe and non-relational database [1.0]


applications are ____________.

a) Persistence systems c) Java object serialization

b) Object database management d) Legacy systems


systems

194. CMP’s are preferred to BMP’s in legacy systems. [0.5]

a) True b) False

195. The calculation of the salary of an employee will be handled by the [1.5]
________________________ component.

a) Application logic c) None of the above


component

b) Persistent data component


196. The employee details, i.e., the name, designation, H.R.A, D.A., etc. [1.5]
will be managed by the _______________________ component.

a) Application logic component c) None of the above

b) Persistent data component

197. Which of the statements given below does not answer the following [1.5]
question.
Why is data treated as an object?

a) It is simple to treat data as an c) Middleware services can be


object gained.

b) Related data can be grouped d) None of the above.

198. Choose the correct answer/s from below. [2.0]

Entity beans are persistent by themselves, because they include:-

a) Serialization. d) Mapping O/R

b) Workflow logic e) Modeling business


processes.

c) Object database persistence

199. Which of the following statements is false regarding entity beans. [1.5]

a) Entity beans may last for years c) The entity bean instance is
an instance of the entity
bean class.

b) Entity beans can survive a d) None of the above.


JVM crash.

200. Which of the following files is not included into the entity bean. [1.5]
a) The entity bean class c) The primary key class

b) The remote interface d) The property file

201. What does an instance of an entity bean represent as per EJB1.1 [2.0]
Specification

a) A row of a database c) A relational table

b) A column of a database. d) None of the above

202. Standard call back methods to manage an entity bean are a must. [1.0]

a) True b) False

203. Invoking of an entity bean is done with the help of the ____________, [1.5]
whereas the client does the creation of the entity bean with the help of
the __________.

a) Remote interface/home c) Primary key


interface class/deployment descriptor

b) Home interface/remote d) Entity bean class/primary


interface key class

204. It is the ___________who provides tools to implement the remote [1.5]


interface while the implementation is the entity bean’s _________.

a) EJB object/EJB container c) EJB container vendor/ EJB


vendor object.

b) Remote interface/primary key d) EJB client/deployment


descriptors

205. A primary key is a/an _______consisting of ‘n’ number of [1.5]


_______________.

a) object/objects c) table/rows
b) interface/objects d) unique ID/beans

206. Suppose there are 100 employee details entity beans then there will [0.5]
be 100 unique IDs.

a) True b) False

207. The primary key class has to be __________. [1.0]

a) remote c) serializable

b) unique d) none of the above

208. The deployment descriptors for the session beans and the entity [0.5]
beans are the same.

a) True b) False

209. The reading and the alterations to the database can be done only [1.0]
within the ________________.

a) container c) remote interface

b) bean d) JVM

210. Which of the following statements is not true. [1.5]

a) The in-memory object is the c) Multiple copies of the same


database data are the entity bean
instances.

b) When the in-memory object d) There is a mechanism to


is updated, the database transfer information between
however is not updated. the database and the Java
object.

211. The client view remains ________________________ independent of [2.5]


the container or location of the entity bean.

a) Same c) Neutral

b) Different d) None of the above.

212. ____________________ EJB class/es may be installed on a single [2.5]


container.

a) A single c) Two

b) Multiple d) No

213. Unlike the remote interface and the home interface the primary key is [2.5]
a ___________ and its definition is bound to a _____________
definition.

a) Object/primary key c) Unique entity/key id

b) Method/method d) Class/bean class

214. If the data in a relational table needs to be updated automatically, [1.0]


without using JDBC then __________________ needs to be used.

a) CMP c) Object-relational
management

b) BMP d) None of the above

215. The _ method reads the data from the persistent storage into the in- [0.5]
memory fields of the entity bean.

a) ejbLoad() c) ejbCreate()

b) ejbStore() d) none of the above

216. The developer is able to call the ejbStore() method explicitly. [0.5]
a) True b) False

217. The entity bean instance implements ____________________ [1.0]


callback method/s, when it is in a pool.

a) one c) three

b) two d) none

218. The _____________ method is used to transition a bean form the [1.5]
instance pool, while ________ is used to send the bean into the pool
instance.

a) ejbLoad/ejbStore c) ejbActivate/ejbPassivate

b) ejbCreate/ejbRemove d) none of the above

219. There are multiple ways to persist entity beans. [0.5]

a) True b) False

220. Using the SQL construct UPDATE through JDBC to update data in a [2.0]
relational database is an example of ________________.

a) CMP c) Object-relational
management

b) BMP d) None of the above

221. Can a blank method be added in the home interface as per EJB 2.0 [2.5]
spec?

a) True b) False

222. Choose the odd one out. [2.0]


Entity beans can -

a) Be created c) Be modified
b) Represent legacy systems d) Do without a primary key

223. The ejbCreate() method should have ___________________ which [2.5]


must ___________ the create() method in the home interface.

a) Objects/be same with c) Parameters/match

b) Beans/differ d) None of the above

224. The EntityContext is relevant to the bean during the call to the [2.5]
_________________________ method.

a) ejbPostCreate() c) ejbActivate()

b) ejbCreate() d) ejbPassivate()

225. In a container-managed bean, the ejbCreate is called _________ [2.5]


writing the bean’s container managed fields to the database.

a) prior to c) simultaneously while

b) after d) none of the above

226. The methods to find an entity bean are listed in the [1.0]
__________________________.

a) Remote interface c) Bean itself

b) Home interface d) Container

227. Creation and modification of entity beans can be done by directly [0.5]
accessing the database.

a) True b) False

228. The _________________________ interface needs to be [0.5]


implemented to be able to write an entity bean class.
a) javax.ejb.EnterpriseBean c) javax.ejb.EntityBean

b) javax.ejb.SessionBean d) none of the above

229. Which of the following is not a method of the javax.ejb.EntityBean [2.0]

a) setSessionContext(SessionContex c) ejbLoad()
t ctx)

b) unsetEntityContext() d) ejbActivate()

230. The ejbCreate() method is compulsory with entity beans if the [0.5]
underlying database data needs to be created.

a) True b) False

231. Which of the following statements is not true while using the [2.0]
ejbCreate() method with entity beans.

a) There are multiple ways to c) Every method provides the


initialize an entity bean client different ways to
instance. create entity beans.

b) The methods in the home d) None of the above.


interface have to be duplicated
in the remote interface.

232. Incase of CMPs the _______________________ implements the [0.5]


finder methods.

a) Bean c) EJB container

b) Component d) Client

233. Which of the following is not a rule for finder methods: [2.0]

a) They have to begin with the c) The methods only have to


ejbFind() method. return an enumeration of
the primary keys.

b) The can be various finder d) There has to be at least one


methods with different names finder method by the name
and parameters. ejbFindByPrimaryKey.

234. Even if the client times out, the ejbRemove() method is called. [0.5]

a) True b) False

235. The ____________________ identifies the bean’s environment. [0.5]

a) Primary key c) Container

b) Context object d) Bean instance

236. The context object adds new methods which are: (choose the correct [1.5]
answer/s)

a) setEntityContext() c) getEJBObject()

b) unsetEntityContext() d) getPrimaryKey()

237. The finder methods defined in the _________________ should match [2.5]
the ejbFind methods in the actual __________.

a) remote interface/client code c) home interface/bean class

b) bean class/remote interface d) client code/database

238. The call back methods invoked on BMPs by the container are defined [1.0]
in the ____________________ interface.

a) javax.ejb.EnterpriseBean c) javax.ejb.EntityBean

b) javax.ejb.SessionBean d) none of the above


239. Match the following. [2.0]

1. ejbPassivate() a. It follows ejbCreate()


2. ejbRemove() b. The bean is returned to the pool
3. ejbStore() c. It will destroy data in the
database
4. ejbPostCreate() d. It will update the database

a) 1 – b, 2 – d, 3 – a, 4 – c c) 1 – d, 2 – c, 3 – b, 4 – a

b) 1 – b, 2 – c, 3 – d, 4 – a d) 1 – a, 2 – b, 3 – c, 4 – d

240. The __________________________ method is called when the [1.0]


container has to increase the pool size by instantiating a new entity
bean.

a) ejbLoad() c) setEntityContext()

b) ejbCreate() d) unsetEntityContext()

241. The ejbLocate() method is used to locate the existing entity bean data [1.0]
instances from within the persistent storage. Do you agree with this
statement?

a) Agree b) Disagree

242. The container creates EJB objects to associate it with bean instances [0.5]
_____________ the data is located and its primary key sent back to it.

a) after c) none of the above.

b) before

243. Initialization of the bean is done by the ______________________ [1.5]


method.

a) ejbPostCreate() c) ejbLoad()

b) ejbActivate() d) None of the above.


244. Once the bean instance is associated with the EJB Object, the [1.0]
_____________________ is called.

a) ejbPostCreate() c) ejbLoad()

b) ejbActivate() d) None of the above.

245. For the ejbActivate() method to function properly, socket connections [0.5]
are important.

a) True b) False

246. The ________ method tells the bean when the data has to be loaded, [1.5]
with the _________ method and also destroyed with the
_______________ method.

a) setEntityContext()/ c) ejbPrimaryKey()/
ejbStore()/ejbDestroy() ejbActivate()/ejbPassivate()

b) FindByPrimaryKey()/ d) getPrimaryKey()/
ejbCreate()/ejbPassivate() ejbLoad()/ejbRemove()

247. The data in a database is ___________________ updated through a [1.0]


storage API, when using the ejbStore() method with BMPs.

a) explicitly c) directly

b) implicitly d) none of the above

248. All the resources allocated to the bean needs to be released, which is [0.5]
done using the ejbRemove() method.

a) True b) False

249. The unsetEntityContext() method is called [1.0]


_________________________ the instance of the entity bean is
destroyed.

a) just after c) simultaneously


b) just before d) none of the above

250. The resources allocated during _________________________ need [0.5]


to be released when using the unsetEntityContext() method is being
used.

a) ejbCreate() c) ejbRemove()

b) ejbActivate() d) setEntityContext()

251. The ___________________of the ejbFind methods in the home [2.5]


interface may differ with those of the bean class, though the
_________________________ and ____________________ should
match.

a) names/arguments/exception c) logic/names/signatures
s

b) arguments/primary d) none of the above


key/methods

252. The major difference between the ejbFind methods of the home [2.5]
interface and the bean class is :

a) When a find method is invoked c) The find method of the home


on the home interface, it is interface throws the
delegated to the FinderException, whereas
corresponding ejbFind method that of the bean class throws
of the bean class. the RemoteException.

b) The arguments of both the d) The methods of the home


methods should differ. interface return either an
object or an enumeration
of that object, while the
remote interface returns
either a primary key or an
enumeration of the primary
key.

253. While using ejbFind method, if a ____________________ needs to be [2.5]


looked up then the method should return an Enumeration, whereas a
single object will be returned if a ________________ is looked up.
a) Single reference/group of c) Primary key/object
references

b) Group of references/single d) Method/class


reference

254. It is possible to write ejbFind methods, which will return arrays using [2.0]
the current version of EJB.

a) True b) False

255. The ejbFindByPrimaryKey() method returns _________________ [1.5]


remote reference/s and takes __________________ parameter/s.

a) Two/two c) Multiple/multiple

b) A single/one d) A single/multiple

256. The state of a bean instance should always be up-to-date with the [2.0]
_________.

a) Bean c) Database

b) Container d) Server

257. The ___________________ exception is necessary for all create [0.5]


methods.

a) FinderException c) ExceptionCreate

b) CreateException d) None of the above

258. The __________________________ methods are called by the [1.0]


container, when the corresponding create() method is invoked by the
client on the bean’s home.

a) create() c) ejbmake()

b) ejbCreate() d) ejbActivate()
259. The findByPrimaryKey() method throws the _________ exception if no [2.5]
matching records are found in the database.

a) ObjectNotFoundException() c) RecordNotFoundException()

b) Null d) RemoteException()

260. ___________ methods are called by the container to manage the [0.5]
bean.

a) Business methods c) EJB-required methods

b) Logic methods d) None of the above

261. Bean-managed State Fields are non-persistent fields. [0.5]

a) True b) False

262. Which of the following is not an EJB required method. [1.5]

a) unsetEntityContext() c) ejbPassivate()

b) ejbActivate() d) ejbStore()

263. The _____ file is the interface used by jBoss to access the database. [0.5]

a) ejb-jar.xml c) jboss.xml

b) jaws.xml d) none of the above.

264. Which of the following files lists the details of the classes and type of [1.0]
the bean along with the name of the primary key.

a) ejbjar.xml c) jboss.xml

b) jaws.xml d) none of the above


265. The bean instance can service ___________________ finder [1.5]
method/s while in the pool.

a) one c) multiple

b) zero d) none

266. To be able to access the database, a connection request needs to be [2.0]


made to the ______.

a) getConnection c) DriverManager

b) Connect d) Driver

267. Which of the following methods is implemented by the developer in [2.5]


BMP ‘s.

a) ejbCreate() d) findByPrimaryKey()

b) ejbStore e) All the above

c) ejbLoad()

268. In EJB, BMPs are more used than CMPs. [0.5]

a) True b) False

269. The data access logic is performed by the __________ in a BMP, [1.0]
whereas in CMPs it is performed by the ______.

a) Bean/container c) Home interface/remote


interface

b) Container/bean d) Remote interface/home


interface
270. The ___________________________ queries the bean instance for [0.5]
all the field values when saving the instances of these fields.

a) Bean c) Container

b) Deployment descriptor d) Classes

271. Which of the following statements is not true with respect to CMPs. [2.0]

a) The developer has to identify c) The above information is


the fields, which are to be given in the deployment
managed by the container. descriptor.

b) The container needs to be d) The logic for saving the


informed about the fields, bean’s instance also has
which it has to manage. to be provided by the
developer.

272. Which of the statements given below, regarding the primary key with [2.0]
respect to entity beans is true.

a) It is optional c) It can have several


attributes

b) It can be of a non-serializable d) It is an object.


class.

273. Client interaction to entity beans is : [2.0]

a) Synchronous c) None of the above

b) Asynchronous d)

274. How does the entity bean know that the database has changed? [2.5]

a) By checking the boolean value c) Both a and b


of the isModified() method in
BMP
b) The container recognizes the d) Entity beans do not know
change in the database in about the changes in the
CMP database.

275. In BMPs, the fields in the primary key class have to come from the [1.0]
container-managed fields of the entity bean class.

a) True b) False

276. The definition of a primary key class is normally bound to the [2.0]
________________________ definition.

a) Remote interface c) Bean class

b) Home interface d) None of the above

277. A constructor with no arguments is compulsory in the primary key [1.0]


class definition. Do you agree with this statement.

a) True b) False

278. Study the code for the primary class definition given below and point [2.5]
out the errors in it.
import java.io.Serializable;

1. public class MyegPK implements java.io.Serializable


{

2. public int myid;


3. public String mydat;

4. public MyegPK () {}

5. public MyegPK(int val,String dat)


{
6. myid = val;
7. mydat = dat;
}

………………
………………
}
a) error in line 2 c) error in line 5

b) error in line 3,4,7 and 8 d) no errors

279. import java.io.Serializable; [2.5]

public class MyegPK implements java.io.Serializable


{

public int myid;


………………………
………………………

public String toString()


{
return String.valueof(myid);
}
}

Is the toString() method given in the above code fragment a valid one.

a) valid b) invalid

280. Match the following. [1.5]

1.ejbFind() a. reset transaction related parameters


2.ejbStore() b. not required for CMPs
3.ejbPostCreate() c. update the database
4.ejbLoad d.utilities required to work with the data are
performed.

a) 1 – a, 2 – b, 3 – c, 4 – d c) 1 – c, 2 – a, 3 – d, 4 – b

b) 1 – b, 2 – c, 3 – a, 4 – d d) 1 – a, 2 – d, 3 – b, 4 – c

281. Requests for resources needed by the instance are made by using the [1.0]
________ method.

a) ejbActivate() c) setEntityContext()

b) ejbPassivate() d) unsetEntityContext()
282. The _______ method should be used in CMP for checking the client [1.0]
parameters.

a) ejbCreate() c) ejbActivate()

b) ejbPostCreate() d) ejbFind()

283. The variable ‘ct’ is used in a CMP entity bean, to indicate whether a [1.5]
row in the database has been updated or not. Which method can be
used to reset the value of the variable ‘ct’.

a) ejbCreate() c) ejbLoad()

b) ejbPostCreate() d) ejbStore()

284. When the container needs to call a bean from the pool and ready it, [1.0]
the method called is:

a) ejbActivate() c) ejbPassivate()

b) ejbStore() d) ejbLoad()

285. Before the ____________________________ method can be called, [0.5]


the data from the database is read.

a) ejbStore() c) ejbCreate()

b) ejbRemove() d) ejbLoad()

286. The ejbLoad() and the ejbStore() methods in container-managed [1.5]


beans may be omitted.

a) True b) False

287. If data in a container-managed field needs to be reformatted before it [2.5]


can be stored in the database, then the ___________ and
___________ methods prove to be useful for the said purpose.

a) ejbLoad()/ejbStore() c) setEntityContext()/
unsetEntityContext()

b) ejbActivate()/ejbPassivate() d) none of the above

288. All resources have to be released before the _________ method is [1.0]
called.

a) ejbActivate() c) setEntityContext()

b) ejbPassivate() d) ejbPostCreate()

289. The ejbActivate() method is called during a transaction. [0.5]

a) True b) False

290. The major advantage of container-managed persistence is: [1.5]

a) It allows the developer to c) The bean can be defined


focus on business logic. independently of the
database used to store its
state.

b) The responsibility of d) All of the above.


persistence is delegated to the
container.

291. The major disadvantage of CMPs is: [1.5]

a) The developer is unable to c) Sophisticated mapping


provide the data access logic. tools are required for
defining the manner in
which the bean’s fields
map to the database.

b) More code needs to be d) The bean is not reusable.


specified for the bean.
292. The __________ interface defines the business methods, which the [1.0]
clients will use to interact with the bean.

a) Remote b) Home

293. The container calls the ____________ method before terminating the [1.5]
life of the entity instance.

a) setEntityContext() c) ejbRemove()

b) unsetEntityContext() d) ejbPassivate()

294. The _______ and _____ methods are associated with the birth of the [1.5]
object.

a) ejbActivate()/ejbPassivate() c) ejbCreate()/ejbPostCreate()

b) ejbLoad()/ejbStore() d) none of the above.

295. The ________ and ____ methods can be invoked by the container [1.5]
any number of times.

a) ejbActivate()/ejbPassivate() c) ejbCreate()/ejbPostCreate()

b) ejbLoad()/ejbStore() d) none of the above.

296. When the transition from the ready state to the pooled state is made, [2.5]
the _______ call is made, whereas the transition back to the ready
state from the pooled state results in the ___________ call.

a) ejbLoad()/ejbStore() c) ejbCreate()/ejbPostCreate()

b) ejbPassivate()/ejbActivate() d) ejbActivate()/ejbPassivate()

297. The code in an individual EJB component can be modified without [1.0]
requiring a change to the interface.

a) True b) False
298. The home interface can have __________________________ create [2.0]
method/s and ___________________________ find method/s.

a) one/one c) zero or more/one or more

b) zero/zero d) none of the above.

299. A lot of bugs are found in the CMP bean.java class. [0.5]

a) True b) False

300. All the container-managed fields need to be declared as [0.5]


_____________.

a) private c) void

b) public d) none of the above

301. The ______________________________ method sets the container- [1.0]


managed fields to the parameters passed by the client.

a) ejbLoad() c) setEntityContext()

b) ejbActivate() d) ejbCreate()

302. For the code of the container to be made available, it has to be [1.0]
__________.

a) compiled c) written

b) decompiled d) generated

303. Study the code fragment given below, which consists of the bean [2.5]
class definition. Is it a valid one, i.e., can the code consist of two
ejbCreate() methods.

import javax.ejb.EntityContext;
………………
public class MyegBean implements EntityBean
{

public int myid;


public String myname;
public double amt;

public String ejbCreate(int myid, String myname, double amt) throws


CreateException
{
this.id = myid;
this.myname = myname;
this.amt = amt;
}
public void ejbPostCreate(………………)
{
…………………
}
public String ejbCreate(int myid, double amt) throws CreateException
{
this.id = myid;
this.amt = 0;
}
public void ejbPostCreate(………………)
{
…………………
}

…………………

a) Valid b) Not valid

304. CMP applications are completely portable. [0.5]

a) True b) False

305. In EJB, the important beans need to determine the information about [0.5]
their status during runtime.

a) True b) False

b) d)
306. Which of the following information is not stored in the context object. [1.5]

a) Home object of the bean. c) Security for authorizing the


client.

b) Environment properties. d) None of the above.

307. The EJB context object can also be called the ____________ to the [1.0]
container.

a) Interface c) Client

b) Gateway d) None of these

308. Callbacks to the container can be performed using __________ [1.5]


because they can be accessed from within the __________.

a) Context objects/beans c) Beans/context objects

b) Beans/container d) Container/context objects

309. Callbacks help the beans to determine their present status. [0.5]

a) True b) False

310. What is the main objective of the context object? [1.5]

a) To store the home object. c) Encapsulate the bean’s


domain in a compact
object.

b) Call backs can be performed. d) All of the above.

311. The context object acts as middleman for storing __________ about [1.0]
the bean.
a) Data c) Status information

b) Context information d) None of these.

312. Which of the following is not a method of the javax.ejb.EJBContext. [1.0]

a) getHome() c) getTransaction()

b) getRollbackOnly() d) getEnvironment()

313. The ________ object is used by the bean to create, find or destroy an [1.0]
EJB object.

a) getHome() c) getCallerinRole()

b) Home() d) setRollbackOnly()

314. Information like the location of a file can be obtained from the [1.0]
__________ object

a) getHome() c) getProperties()

b) getEnvironment() d) none of these.

315. The ________________ method returns the security identity of the [1.0]
client.

a) isCallerinRole() c) CallerIdentity()

b) getCallerIdentity() d) setCallerIdentity()

316. Whether a client can perform a particular operation or not is [1.0]


determined by the ____________ method.

a) isCallerinRole() c) isCallerRole()

b) getCallerIdentity() d) setCallerinRole()
317. A Boolean value is returned by the ________________________ [1.0]
method.

a) setRollbackOnly() c) RollbackOnly()

b) getRollbackOnly() d) setRollback()

318. The getUserTransaction() method is applicable for those beans [1.0]


which____________.

a) do not perform transactions. c) Perform transactions on


their own.

b) Perform only one transaction. d) None of these

319. The context in EJB is found only in Entity beans. [0.5]

a) True b) False

320. The SessionContext interface extends the _______________ [0.5]


interface.

a) SessionContext c) EntityContext

b) EJBContext d) Context

321. Session beans have to represent a _______________________, [1.0]


which is called by the container, so that the bean can be associated
with a particular context.

a) Context c) Object

b) Method d) Class

322. To associate an entity bean with a particular context, a call is made to [0.5]
__________.

a) setSessionContext(SessionContex c) setEntityContext(EntityContex
t ctx) t ctx)

b) javax.ejb.SessionBean d) javax.ejb.EntityBean.

323. The method body of a callback method can be left blank in the bean [0.5]
class.

a) True b) False

324. A bean can act as a client for other beans. [0.5]

a) True b) False

325. When a reference needs to be passed to a bean, then the [1.0]


____________ method is used.

a) setEJBObject() c) getEJBReference()

b) getEJBObject() d) setEJBReference()

326. As in Java, it is also possible in EJB to use the ‘this’ keyword for self- [1.0]
reference by a bean.

a) True b) False

327. Which of the following correctly represents the interface for the entity [2.5]
context.

a) public interface c) public interface


javax.ejb.SessionContext javax.ejb.EntityContext
extends extends
javax.ejb.EJBContext javax.ejb.EJBContext
{ {
public public abstract EJBObject
javax.ejb.EJBObject getEJBObject()throws
getEJBObject(); illegalStateException;
}
public abstract Object
getPrimaryKey()throws
illegalStateException;

b) public interface d) public interface


javax.ejb.EntityContext javax.ejb.EntityContext
extends javax.ejb.EJBContext {
{ public abstract EJBObject
public abstract EJBObject getEJBObject();
getEJBObject(); }
}

328. The _______________________________ method needs to be [1.5]


called at the end of the bean instance’s life.

a) setEntityContext() c) getEJBObject()

b) unsetEntityContext() d) removeEJBObject()

329. The two important security aspects in EJB are _________ and [1.0]
__________.

a) username/password c) authentication/authorizatio
n

b) secrecy/validity d) none of the above

330. An online shopping mall has given all its customers a unique customer [1.5]
id, which the client needs to enter whenever he/she logs on to that
site. The id is verified and only then is the customer allowed to
proceed further. This is an example of:

a) Authorization c) Validity

b) Authentication d) Identification

331. What is the difference between authentication and authorization. [1.5]

a) There is no difference c) One is performed before


calling the EJB method,
while the other occurs
during the EJB method.

b) One addresses security and d) None of the above.


the other addresses access
control in EJB.

332. An online shopping mall has given all its customers a unique customer [1.5]
id, which the client needs to enter whenever he/she logs on to that
site. Based on the customer id, the customer is allowed a certain
amount of discount on particular products. The id is verified and only
then the customer is allowed to proceed further and is taken to the
relevant page for shopping. This is an example of:

a) Authorization c) Validity

b) Authentication d) Identification

333. The two ways of performing authorization are _______ and [1.0]
_________.

a) Authenticative/configuration c) Creative/development

b) Declarative/programmatic d) None of these

334. Which of the following steps are not performed during declarative [1.5]
authorization.

a) Validations are performed by c) Focus is entirely on business


the container. logic.

b) Security checks are coded d) Requirements are entered


into the bean. into the deployment
descriptor.

335. The EJB context needs to be queried during security authorization. [0.5]

a) True b) False
336. The methods available for programmatic authorization are ________ [1.5]
and __________.

a) setRollbackOnly() / c) isCallerInRole(identity
getRollbackOnly() role)/ getCallerIdentity()

b) getUserTransaction() / d) none of these.


getEnvoronment()

337. The isCallerInRole(identity role) checks the security role defined in the [1.0]
__________________.

a) deployment descriptor c) remote interface

b) code d) home interface

338. Security roles may be omitted in EJB. [0.5]

a) True b) False

339. Security roles can be specified based on the type of [0.5]


_______________ used.

a) application server c) container

b) client d) EJB component

340. The Access Control does not take care of : [1.0]

a) User’s access to data c) Sub-systems

b) Business objects d) Client’s identities

341. The __________________________ enables outsiders to modify [1.0]


security rules without modifying the bean code.

a) Access control c) Declarative security

b) Security roles d) None of these


342. Suppose an enterprise bean represents an employee’s salary [2.0]
account. The employee, who is also the caller of the bean can modify
the salary details, though he should not be able to do so as it is the
responsibility of the accountant. Which security feature is required, so
that only the accountant is able to modify the salary details.

a) Declarative security c) Security roles

b) Programmatic security d) Access control

343. Which of the following statements is not true with respect to security [2.0]
propagation.

a) Security checks are possible c) The security contexts are


because security contexts. visible in the application
code.

b) When a method is called, the d) The security context is


container uses the security passed implicitly inside the
contexts to propagate the stub as skeletons.
security information.

344. The ___________________________method indicates the security [1.0]


identity, which is required for the bean to perform operations such as
calling various other beans.

a) runAsMode c) SYSTEM_IDENTITY

b) runAsIdentity d) CLIENT_IDENTITY

345. Match the following: [2.5]


CLIENT_IDENTITY a. circulate the client’s security context
SYSTEM_IDENTITY b. run the bean using system-level
authority
SPECIFIED_IDENTITY c. runAsIdentity

a) 1 – a, 2 – b, 3 – c c) 1 – c, 2 – a, 3 – b

b) 1 – c, 2 – b, 3 – a d) 1 – b, 2 – c, 3 – a
346. Assume that there are two containers A and B. Container A calls a [2.0]
method in Container B, then the security context of container A be
passed on to container B

a) True b) False

347. To resume the operations of an application, which was temporarily [1.0]


stopped, ______________________ needs to be used.

a) components c) object handles

b) objects d) containers

348. In a system where only certain users can update information, while [2.0]
others can only view this data, is an example of:

a) authentication c) secure communication

b) access control d) Security roles

349. Authentication can be accomplished using the ____________. [2.5]

a) Remote interface c) Home interface

b) Container d) JNDI API

350. As per EJB specifications every client application accessing an EJB [2.5]
system should be associated with a
________________________________ object.

a) java.security c) java.Identity

b) java.security.Identity d) none of these

351. The _____________________________ decides who get to access [2.0]


the bean’s methods.
a) container c) home interface

b) remote interface d) person deploying the bean

352. When a client logs on to an EJB system, it is associated with a/an [2.5]
______________________ for the duration of that session.

a) context object c) bean object

b) client object d) Identity object

353. The _____ keeps track of every client and its Identity object. [2.5]

a) EJB client c) Container

b) EJB server d) Home interface

354. ___________ are services, which are required for robust server-side [1.0]
development.

a) Scalability c) Security services

b) Resource pooling d) Transactions.

355. Transactions are useful for performing persistent operations. [0.5]

a) True b) False

356. Transaction programming can be ______________________ [1.5]


and/though its benefits can still used with the help of
_____________________.

a) Performed/transactions c) Omitted/beans

b) Written/container d) Avoided/EJB
357. Exceptions can be used to solve atomic problems. However, it has its [1.5]
disadvantages. Which of the following statements is not a
disadvantage.

a) The code will be huge. c) Error handling will go out of


control if more complex
processes are to be
performed.

b) Every single problem that can d) Quality Assurance will be


occur at every step has to be greatly enhanced.
considered and looked into.

358. Incase of network crash, an exception will be thrown back to the client [1.0]
code, which will help distinguish when the crash occurred. Do you
agree with this statement?

a) Agree b) Disagree

359. With the help of transactions, multiple users can share data as it [2.0]
performs various functions. Which one is not one of them?

a) Allow two users to c) Ensures that the updated


simultaneously change the data is completely and
same data. wholly written.

b) Allow users to share the same d) Perform necessary locking


data. controls to keep client
threads from affecting each
other in the database.

360. ________ is an application component, which may be an Enterprise [0.5]


bean, a server component or a CORBA object.

a) Resource c) Transactional Object

b) Transaction Manager d) Resource Manager

361. The ______________________ operates behind the scenes [1.0]


performing all its tasks.
a) Transaction Manager c) Resource

b) Transactional Object d) Resource Manager

362. The ________________ represents storage from where one can read [0.5]
and write.

a) Transaction Manager c) Resource

b) Transactional Object d) Resource Manager

363. The ____________________ also manages the state of the bean. [0.5]

a) Resource c) Transactional Object

b) Transaction Manager d) Resource Manager

364. What does the C in ACID stand for? [1.0]

a) Container c) Consistency

b) Component d) Class

365. Multiple operations when grouped together to appear as one unit of [1.0]
work is called __________.

a) A database c) Atomicity

b) Transactions d) None of these

366. A transaction is used to perform a banking job, which includes [2.0]


deduction of withdrawals and addition of deposits in all the current
accounts taking place every two minutes. If one of these transactions
fail, then will the database will :

a) Be restored to its original c) Show only the first operation


state, i.e., the one before the in the transaction.
transaction began
b) Be in the partial state, i.e., till d) Show the final state, i.e.,
the transaction failed. after all the transactions
have been completed,
irrespective of the failure.

367. __________ ensures that a transaction leaves the system’s state as [1.0]
consistent once the transaction is completed.

a) Atomicity c) Isolation

b) Consistency d) Durability

368. The major advantage of isolation is that the client feels that [1.5]
______________________.

a) All the clients are modifying c) The data cannot be


the data. modified.

b) Only he/she is modifying the d) The data is already modified.


data.

369. Isolation is achieved in the transaction system by making use of a [0.5]


_________on the underlying database data.

a) middle-level synchronization c) low-level synchronization


protocol protocol

b) high-level synchronization d) synchronization protocol


protocol

370. _____ ensures that updates to the managed resources are able to [0.5]
survive failures like network crashes.

a) Atomicity c) Isolation

b) Consistency d) Durability

371. The two major transactional models are __________ and [1.0]
_____________.
a) Flat transactions/nested c) Durable
transactions transactions/consistent
transactions

b) Atomic transactions/Isolated
transactions

372. Which of the following statements do not represent a flat transaction. [1.5]

a) ‘N’ number of applications can c) The result is either success


be performed when flat or failure.
transactions are started.

b) When the transactions end, a d) Units of work can be


binary result is provided. embedded in other units of
work.

373. A failed transaction is ______ whereas a successful transaction is [1.0]


________.

a) Roll backed/saved c) Abandoned/accepted

b) Aborted/committed d) None of these

374. A transaction will not be aborted in which case. [1.5]

a) When invalid parameters are c) When the database is


passed to components being updated.

b) When there is a hardware or d) An invariant system state


software failure. was violated.

375. Consider the following scenario. The salary of several employees is [2.5]
being calculated using transactions, where first the number of working
days for an employee is calculated and stored in the database, and
nested within it the additional perks are calculated which is based on
the number of working days. Subsequently, the database is updated
with the perk amount. Suppose the calculation of an employee’s perk
amount fails for some reason, then the database will represent:
a) The original state, i.e., even c) The present state, i.e., the
the number of working days number of working days and
will not be stored. some junk perk amount will
be stored

b) The current state, i.e., the d) None of the above.


number of working days will be
stored.

376. Consider the following scenario. The salary of several employees is [2.5]
being calculated using transactions, where first the number of working
days for an employee is calculated and stored in the database, and
nested within it the additional perks are calculated which is based on
the number of working days. Subsequently, the database is updated
with the perk amount. Suppose a rollback is performed during the
calculation of an employee’s perk then the database will represent:

a) The original state, i.e., even c) The present state, i.e., the
the number of working days number of working days and
will not be stored. some junk perk amount will
be stored

b) The current state, i.e., only d) None of the above.


the number of working days
will be stored.

377. Which of the following is supported as per the EJB specification. [1.0]

a) Chained transactions c) Sagas

b) Nested transactions d) Interaction of the bean with a


resource manager.

378. A transaction starts with a __________ and finishes with a _______. [1.0]

a) Begin/end c) Commit/abort

b) Start/end d) None of these


379. The process of deciding who begins a transaction, who issues a [1.0]
commit or abort and when do these steps occur is called:

a) Transaction cycle c) Demarcating transactional


boundaries

b) Transaction boundary d) None of the above.

380. Components are automatically listed in ________________________ [0.5]


transactions.

a) Programmatic c) Chained

b) Declarative d) Nested

381. __________________________ is the separation of multiple users [0.5]


from one another though they may use the same database.

a) Isolation c) Atomicity

b) Consistency d) Durability

382. _______ isolation levels ensure low levels of performance, whereas [1.0]
_______ isolation levels lead to high performance.

a) Loose/stringent c) lower/great

b) Stringent/loose d) None of these

383. The EJB container inspects the _________________________ in [1.0]


order to apply appropriate isolation levels to the beans

a) Remote interface c) Bean class

b) Home interface d) Deployment descriptor

384. The ____________ mode offers performance at the highest level. [0.5]

a) TRANSACTION_READ c) TRANSACTION_REPEATABLE
_UNCOMMITTED _READ

b) TRANSACTION_READ d) TRANSACTION_SERIALIZABLE
_COMMITTED

385. The dirty read problem is solved by the [0.5]


______________________________ mode.

a) TRANSACTION_READ c) TRANSACTION_REPEATABLE
_UNCOMMITTED _READ

b) TRANSACTION_READ d) TRANSACTION_SERIALIZABLE
_COMMITTED

386. Reading of uncommitted data from the database represents the [1.0]
___________________________ problem.

a) Unrepeatable read c) Phantom

b) Dirty read d) None of the above

387. In a banking transaction, a clerk accesses a wrong account number by [2.0]


mistake and makes changes to the amount in it. Before he can issue
a commit, another clerk accesses the same account number and
again makes changes to it. The first clerk realizes his mistake and
issues an abort. However, the second clerk after making certain
modifications to the said amount saves it to the database. The
database thus shows an incorrect amount. The above problem
represents the ________________ problem.

a) Dirty read c) Phantom

b) Unrepeatable read d) Inconsistency

388. When a component reads data from a database, and upon reading it a [1.0]
second time, finds that the data has changed, it is called the
______________________ problem.

a) Dirty read c) Phantom

b) Unrepeatable read d) Inconsistency


389. The main difference between the unrepeatable read problem and the [1.5]
phantom problem is that the former occurs when _________ and the
latter occurs when__________.

a) existing data is c) uncommitted data is


changed/new data is read/persistent data is read
inserted

b) new data is inserted/ Existing d) none of these


data is changed

390. Distributed flat transactions allow multiple application servers to [0.5]


collaborate under one transactional cover.

a) True b) False

391. The transactional journal is like a/an _________and it is___________, [1.5]


which makes it capable of surviving crashes.

a) Book/perishable c) Interface/modifiable

b) Log/ persistent d) None of the above

392. In an organization, all new employees start with a grade of E5. The [2.0]
general manager performs a query to view all the employees with this
grade. However, the HRD manager after recruiting two new
employees adds their record into the database. The general manager
on performing the same query again, will now see a different set of
data. This problem can be addressed as the ______________
problem.

a) Unrepeatable read c) Phantom

b) Dirty read d) Inconsistency

393. All actual data updates are performed by the resource managers, [1.0]
which are located and controlled separately in _________.

a) Phase one b) Phase two


394. Arrange the steps in which the two-phase commit works. [2.0]
1. Each transaction manager then reports back to the
transaction coordinator. If everyone agrees to commit, then
commit is called in case of a crash.

2. The transaction coordinator asks each transaction manager


to commit.

3. Each of the transaction managers spreads the message to


the resource managers, tied to that particular transaction
manager.

4. The transaction coordinator will send a prepare to commit


message to every transaction manager that is involved.

a) 1 – 2 – 3 – 4 c) 3 – 2 – 4 – 1

b) 4 – 3 – 1 – 2 d) 2 – 1 – 4 – 3

395. The ___________is the most important piece of information sent over [1.0]
the transactional communication.

a) object c) IIOP

b) transaction manager d) transactional context

396. To be able to control transaction boundaries the [1.0]


__________________ is required.

a) API c) CORBA

b) JTA d) JTS

397. The OTS is broken into the ____________ and ______________. [1.0]

a) The CosTransactions c) SessionContext


interfaces/ The interface/EntityContext
CosTSPortability interface interface
b) Home interface/remote d) None of these
interface

398. The developer needs to be concerned about the OTS. [0.5]

a) True b) False

399. The OTS has been separated into two APIs that are: [1.0]

a) CORBA/RMI c) JTA/JTS

b) DCOM/MOM d) APIJ/JAPI

400. Which of the following should a programmer be concerned about? [2.0]

a) JTA c) OTS

b) JTS d) None of these

401. The JTA is a _________________________. [1.0]

a) Interface c) Object

b) Class d) Package

402. Which of the following is not a functionality of the JTA. [2.0]

a) A transaction can be started c) Other beans can be called.


inside a bean

b) Two methods can be d) Components other than


simultaneously invoked on a beans can also use JTA.
bean.
403. In stateless session bean, an exception is thrown to the ___________ [1.5]
but in the case of a stateful session bean, throwing an exception will
lead to ___________.

a) Container/the bean c) Client/loss of time

b) Server/EJBserver d) Client/gain in time

404. The interface _________interface is implemented in the bean [1.0]


class along with other methods.

a) javax.ejb.SessionSynchronizatio c) javax.ejb.EntityBean
n

b) javax.ejb.SessionBean d) none of these

405. What are the different Transaction isolation levels set during deployment? [2.5]
(Choose the correct answer/s)

a) TRANSACTION_READ c) TRANSACTION_SERIALIZABLE
_UNCOMMITTED

b) TRANSACTION_REPEATABLE d) TX_REQUIRED

406. In an online shopping site, the client is allowed to select multiple items [2.5]
and then place his/her order. As a developer, how would you allow the
user to cache the items and then write them to the database after the
transaction is complete?

a) By implementing the c) By implementing the


SessionBean interface. EntityBean interface.

b) By implementing the d) None of the above


SessionSynchronization
interface.

406. public class Mybean implements SessionBean, [2.5]


SessionSynchronization
{
……………..
public int num;
public void ejbCreate(int num) throws CreateException
{
this.num = num;
}

public int inc()


{
return (num –1);
}

public void afterCompletion(boolean bl)


{
if (bl==false) ++num;
}
………………
}

What will happen if a transactional abort occurs in the above program.

a) The value in num remains c) The value of num is


unchanged. decremented.

b) The value of num is restored d) None of these


to its original value.

You might also like