3i Infotech Papers: Sample Questions 1049 - 1050 of 1245

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 1049

» Languages » Java

Appeared in Year: 2004

MCQ▾

Question

What happens if Database Updation code is written in ejb Passivate () method and if this method is called?

Choices

Choice (4) Response

a.

Successfully executes the Database Updation code

b.

Compilation error occurs indicating that Database Updation code should not be written in ejbPassivate ()

c.

Ejb Store () method is called

d.

Exception is thrown

Answer

c.

Explanation

  • Ejb Passivate method is called when it is necessary to synchronize the bean data with the database.

  • This will most likely trigger an UPDATE to occur.

  • The ejb Store is triggered when the bean is no longer being used by a client and the container decides to move the ready instance back into the pooled state. nullejbLoad method: ejb Store method:

  • Database Updation code is written in ejb Passivate () method and this method is called in ejb Store ().

    • Vendor implementations may differ slightly as to when the ejb Store () method is called, but this is not the bean developer’s concern.

    • The ejb Store () method will be called after one or more business methods have been invoked or at the end of a transaction.

Question number: 1050

» Basic CS » Operating System

MCQ▾

Question

Which is not a memory management scheme?

Choices

Choice (4) Response

a.

Monitors

b.

Buddy system

c.

Paging

d.

Swapping

Answer

a.

Explanation

Monitors are not a memory management scheme.

Buddy system:

Understanding of buddy system.

Understanding of Buddy System.

Understanding of buddy system.

  • Buddy system is a memory allocation and management algorithm to manage memory in powers of two.

  • From a memory of size suppose a chunk of size S is required:

  • In buddy system if the system allocates the whole block.

  • Else each block is tested for condition when the condition is satisfied that block is allocated.

Swapping:

  • Swapping allows processes to be temporarily put out of main memory to secondary storage making that memory available to other processes.

  • System can later swaps back the process from the secondary storage to main memory.

  • Swapping processes helps in running multiple and big processes in parallel.

  • Swapping is also known as a technique for memory compaction.

Paging:

  • Paging allows a computer to address more memory than physically installed on system- called virtual memory.

  • In paging a process’s address space is broken into blocks of the same size called pages.

  • These pages are then swapped to or from the hard disks to the main memory as and when required.