• Menu
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

JavaBeat

Java Tutorial Blog

  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)
  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)

SCBCD 5.0 Mock Exam – 1

1)application Exception myException can automatically mark transaction for roll back:-

1. ApplicationException is applied to the myException class
2. <exception-class>myException</exception-class> is used inside <application-exception> element in deployment descriptor
3. constructor of myException class calls EJBContext.setRollbackOnly()
4. ApplicationException is applied to myException class, and rollback subelement of application-exception is specified as true

2)If message driven bean allocate resources in PostConstruct lifecycle callback , and releases these resources in PostDestroy, these resources will always be automatically release by container when instance is discarded

3)choose correct statement

1.methods of business interface may throw java.rmi.RemoteException
2.Methods of local and local home interface may throw java.rmi.RemoteException
3.Methods of web service end points interface may throw java.rmi.RemoteException
4.Methods of remote and remote home interface must not throw application exception

4)If client receives application exception

1.Instance is discarded, so client should repeat all operations again
2.Client can continue calling the enterprise bean and recover.

5)Local and Remote clients that are enterprise beans, and use BMT can use EJBContext.getRollbackOnly to test whether the transaction has been marked for transaction or not

6)if client receives javax.ejb.EJBException then (choose two best answers)

1.The client knows for sure that the EJB method it invoked has not been completed
2.The client does not know if the EJB method it invoked has completed or not
3.If the client executes in context of transaction , the transaction is marked for roll back
4.if client executes in context of transaction, the client’s transaction, may or may not have been marked for roll back

7)A method of business interface of CMT bean throws non-application exception, then the client will receive :- (choose two best answers)

1.javax.ejb.EJBTransactionRolledbackexception if bean executes within caller’s transaction and with required transaction attribute
2.Javax.ejb.EJBException if bean executes within transaction started by container, and with requiresNew transaction attribute
3.Java.rmi.RemoteException if bean executes within caller’s transaction and with required transaction attribute
4.Javax.ejb.EJBException if bean executes within caller’s transaction and with Mandatory transaction attribute

8)Methods that are not assigned to any security role, not annotated with DenyAll , and not included in the exclude-list , are treated by container as ——–

9)Security roles declared by bean provider\assembler using security-role-ref correspond to users, groups, or principals in the operational environment.

10)Suppose principals of operational environment are mapped to security-role payroll-department, then what element should be used to implicitly map these principals to the logical role payroll?

1.<security-role>payroll-department</security-role>
2.<security-role>payroll</security-role>
3.<security-role-ref><role-name>payroll</role-name><role-link>payroll-department</role-link></security-role-ref>
4.<security-role-ref name=”payroll-department”><security-role>payroll</security-role></security-role-ref>

SCBCD 5.0 Mock Exam 1 – Answers

1.4)ApplicationException is applied to myException class, and rollback subelement of application-exception is specified as true

2.false

3.3)Methods of web service end points interface may throw java.rmi.RemoteException

4.2)Client can continue calling the enterprise bean and recover.

5.false

6.2 & 4)
The client does not know if the EJB method it invoked has completed or not
if client executes in context of transaction, the client’s transaction, may or may not have been marked for roll back

7.1 & 2)
javax.ejb.EJBTransactionRolledbackexception if bean executes within caller’s transaction and with required transaction attribute
Javax.ejb.EJBException if bean executes within transaction started by container, and with requiresNew transaction attribute

8.unchecked

9.false , they represent logical security view

10.3)<security-role-ref><role-name>payroll</role-name><role-link>payroll-department</role-link></security-role-ref>

Primary Sidebar

Follow Us

  • Facebook
  • Pinterest

FEATURED TUTORIALS

New Features in Spring Boot 1.4

Difference Between @RequestParam and @PathVariable in Spring MVC

What is new in Java 6.0 Collections API?

The Java 6.0 Compiler API

Introductiion to Jakarta Struts

What’s new in Struts 2.0? – Struts 2.0 Framework

JavaBeat

Copyright © by JavaBeat · All rights reserved
Privacy Policy | Contact