Wednesday 3 February 2016

Interview Questions for Database Adapter

1) Why database adapter used in SOA Suite?.
 Database adapter is one of the technology adapter, we use this adapter to interact with database.
2)What all operations we can perform in database adapter ?.
 We can perform following operations in database adapter.
1. Store Procedure or Function call.
2. CRUD operations
• Select
• Update
• delete
• Insert
• Merge
3. Poll new or updated records
4. Pure Sql
3) Database adapter falls under Transactional or non-transactional adapters ?.
 Database adapter is a transactional adapter.
4) Difference between XA & Non-XA transaction ?
Non-XA (Local Transaction): It involves only one resource. When you use Non-XA transaction then you can’t involve multiple resources (different databases, Queues, application servers etc), you can rollback or commit transaction for only one resource. There is not transaction manager for this transaction as we are dealing with only one resource at a time.
XA (Global Transaction): It involves more than one resource (different databases, queues, application servers) all participate in one transaction. It uses two-phase commit to ensure that all resources either all commit or rollback any particular transaction. When you have scenario like you need to connect to two different databases, JMS Queue and application server, in this case you will use XA transaction that means all resource participate in one transaction only.
5)What is logical delete ?.
 When we poll for new or changed records using database adapter, we have multiple options after reading the data. Either we can delete the row from table (physical delete) which is not recommended or we can update the column in source table with new value (logical delete).
E.g. Source table has one column with the name flag, we read the data from source table when flag column has value “N” and after we read the data then we update the flag value to “Y”.
6)What is Data Source?.
 We specify database details to connect to database, if we hard code these details in code then we need to change code to reflect new details when we move to next environment so to solve this problem, data source concept came where we specify database details so that we need not to make changes in code. We just update the data source configuration in different environment.
When we use database adapter to connect to database, we need to specify outbound connection pool. That outbound connection pool further refer to data source.
7) How we can limit the number of rows fetched using database adapter ?
 We can limit the number of rows fetched using ” Database Rows per Transaction” property. For example, assume there are 10,000 rows at the start of a polling interval and this field is set to 100. In standalone mode, a cursor iteratively reads and processes 100 rows at a time until all 10,000 rows are processed, dividing the work into 10,000/100=100 sequential transactional units
8) How we can limit the number of rows per XML message while sending the message from database adapter to consumer ?.
By using “Database Rows per XML Document” property

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete