Pages

Ads 468x60px

Saturday, 13 October 2012

Explain about Three-tier architectures


Three-tier architectures

WebSphere Application Server provides the application logic layer in a three-tier architecture, enabling client components to interact with data resources and legacy applications.
Collectively, three-tier architectures are programming models that enable the distribution of application functionality across three independent systems, typically:
  • Client components running on local workstations (tier one)
  • Processes running on remote servers (tier two)
  • A discrete collection of databases, resource managers, and mainframe applications (tier three)
These tiers are logical tiers. They might or might not be running on the same physical server.
Three tier architecture
First tier. Responsibility for presentation and user interaction resides with the first-tier components. These client components enable the user to interact with the second-tier processes in a secure and intuitive manner. WebSphere Application Server supports several client types. Clients do not access the third-tier services directly. For example, a client component provides a form on which a customer orders products. The client component submits this order to the second-tier processes, which check the product databases and perform tasks that are needed for billing and shipping.
Second tier. The second-tier processes are commonly referred to as the application logic layer. These processes manage the business logic of the application, and are permitted access to the third-tier services. The application logic layer is where most of the processing work occurs. Multiple client components can access the second-tier processes simultaneously, so this application logic layer must manage its own transactions.
In the previous example, if several customers attempt to place an order for the same item, of which only one remains, the application logic layer must determine who has the right to that item, update the database to reflect the purchase, and inform the other customers that the item is no longer available. Without an application logic layer, client components access the product database directly. The database is required to manage its own connections, typically locking out a record that is being accessed. A lock can occur when an item is placed into a shopping cart, preventing other customers from considering it for purchase. Separating the second and third tiers reduces the load on the third-tier services, supports more effective connection management, and can improve overall network performance.
Third tier. The third-tier services are protected from direct access by the client components residing within a secure network. Interaction must occur through the second-tier processes.
Communication among tiers. All three tiers must communicate with each other. Open, standard protocols and exposed APIs simplify this communication. You can write client components in any programming language, such as Java or C++. These clients run on any operating system, by speaking with the application logic layer. Databases in the third tier can be of any design, if the application layer can query and manipulate them. The key to this architecture is the application logic layer.

Configuring JDBC, Explain about JNDI

1. What is JDBC, JNDI? 
      

      JDBC – Java Database Connectivity 
      JNDI – Java Naming and Directory Interface



2. What type of driver you are using? Type 4 driver ?

  Type 1 driver: JDBC-ODBC Bridge
  This driver called as JDBC-ODBC bridge.The Java Statements converts to JDBC statements.JDBC   statements calls ODBC by using JDBC-ODBC bridge. ODBC drivers convert into the requirements of databases.
  Java--->JDBCStat-->JDBC-ODBC bridge-->ODBC-->Databases.
  Type 2 driver: Native-API/partly Java driver
  This driver is called as Native Driver where it requires the some native code to connect to the       databases.
  Type 3 Driver: Net-protocol/all-Java driver
  This driver is called as Protocal driver where
  Java-->JDBC statements-->SQLStatements--> databases.
  Type 4 Driver: This driver directly converts the java statements to SQl Statements which    require to databases. It wont convert to JDBC statement

3. what is meant by connection pooling?

connection pool is a 
cache of database connections maintained by the database so that the connections can be reused when the database receives future requests for data. Connection pools are used to enhance the performance of executing commands on a database. Opening and maintaining a database connection for each user, especially requests made to a dynamic database-driven website application, is costly and wastes resources. In connection pooling, after a connection is created, it is placed in the pool and it is used over again so that a new connection does not have to be established. If all the connections are being used, a new connection is made and is added to the pool. Connection pooling also cuts down on the amount of time a user must wait to establish a connection to the database

4. What is JNDI ?

  We can register resources in the application server’s java naming and directory interface (jndi)  namespace. Client applications can then obtain the references to these resource objects in their programs.


Configuring a JDBC provider using the administrative console
  1. Open the administrative console.
  2. Click Resources > JDBC Providers.
  3. Select the scope at which applications can use the JDBC provider. (This scope becomes the scope of your data source.) You can choose a cell, node, cluster, or server
  4. Click New.
  5. Use the first drop-down list to select the database type of the JDBC provider you need to create.
If the list of database types does not include the product that you want to use, select User-Defined. This selection triggers the console to display your provider type as User-defined JDBC provider, and your implementation type as User-defined.
From the second drop-down list, select your JDBC provider type.
  1. From the third drop-down list, select the implementation type that is necessary for your application. If your application does not require that connections support two-phase commit transactions, choose Connection Pool Data Source. Choose XA Data Source, however, if your application requires connections that support two-phase commit transactions. Applications that use this data source configuration have the benefit of container-managed transaction recovery.
  2. Click Next to view the general property settings page for your JDBC provider.
  3. Ensure that all required properties have valid values.
  4. Click Apply to view the page with your new JDBC provider settings. Note that two active data source links now appear under the Additional Properties heading on this page. To set up a data source, click the link that corresponds to the type required by your application
  5. Click OK to return to the JDBC providers page, where your new JDBC provider appears in the list.
Remember: If you modify the class path or native library path of a JDBC provider, click OK and then restart every application server within the scope of that JDBC provider. Otherwise, the new configuration does not work, and you receive data source failure messages
Configuring a data source using the administrative console
  1. Open the administrative console.
  2. Click Resources > JDBC Providers.
  3. Choose the JDBC resource provider under which you want to create your data source. The detail page for this provider is displayed.
  4. Under Additional Properties, click the Data Sources link that is appropriate for your application. The Data sources or Data sources (Version 4) page is displayed.
  5. Click New to display the Data source settings page.
  6. Verify that all the required properties have valid values.
The following steps guide you through supplying the property values, a process that is basically the same for both data source types:
    1. Select a DataStoreHelper class name.
      • You can choose a DataStoreHelper class name from the list that is provided. The application server provides a class called DataStoreHelpers, or you can keep the default selection.
      • To use a data store helper other than what is provided, click Specify a user-defined DataStoreHelper. Type a fully qualified class name in the field that is provided.
    2. The next section of properties varies according to the database selection, provider type, and implementation that you chose for your JDBC provider. These properties are either required or highly recommended for your data source. Provide valid values for these settings if you do not want to accept the default values.
    3. Click Component-managed Authentication Alias if your database requires a user ID and password for a connection. This alias is used only when the application resource reference is using res-auth = Application.
Important:(For components with res-auth=Container) Both the Container-managed Authentication Alias and Mapping-Configuration Alias settings are deprecated. They are superseded by the specification of a login configuration on the resource-reference mapping at deployment time. You must now use this login setting to define the aliases at deployment.
    1. If you chose XA Data Source as the implementation type of your JDBC provider, you need to specify the alias used during transaction recovery processing. An additional section entitled Authentication Alias for XA Recovery is available. Select either Use Application Authentication Alias to use the same value that you chose for component-managed authentication, or select Specify: to choose a different alias from the drop-down list.
  1. Click Apply to view a page with your new data source settings. Additional properties and Related items sections are now available on this page. Additional properties contains the Connection pool, Custom properties, and WebSphere Application Server data source properties choices. (If you are using a Version 4 data source, however, you see only the Connection pool and Custom properties links.)
    1. Click on the first link to define settings that affect the behavior of the Java 2 Connector (J2C)
    2. Use the WebSphere Application Server data source properties page to input settings that exclusively affect the application server's connection to the database.
    3. Go to the Custom properties page to view and modify additional properties that the database vendor might require or recommend for the connection of its product to an application server.
    4. The Related items section (applicable only to later version data sources, not Version 4 data sources) contains the J2C Authentication data entries choice. Here, you can specify a list of user IDs and passwords for J2C security to use.
  2. Click Save.
  3. Return to the data source page to confirm that your new data source is displayed in the list
Trace strings for JDBC data sources

 Identify your database type by selecting the trace group WAS.database and typing one of the following trace strings in the console:
  • com.ibm.ws.database.logwriter Trace string for databases that use the GenericDataStoreHelper. You can also use this trace string for unsupported databases.
  • com.ibm.ws.db2.logwriter Trace string for DB2 databases.
  • com.ibm.ws.oracle.logwriter Trace string for Oracle databases





Friday, 12 October 2012

WebSphere Application Server Interview Questions Part-1


1.What is WebSphere?

   WebSphere refers to a brand for IBM software products. It is designed for setting up, operation and integration of electronic business applications. These applications could perform well on cross platform environment. These set of software are java based web technologies.

WebSphere is a set of Java-based tools from IBM that allows customers to create and manage sophisticated business Web sites.


2.What is master repository?

  Deployment manager contains the MASTER configuration and application files. All updates to the configuration files should go through the deployment manager.

3. WebSphere packages?

    Express, base, network deployment

4. Diff b/w 5.0 and 6.0?

   Web Sphere Studio 3.5, comes up with Visual Age for Java. WSAD 5.0 supports J2EE 1.3 java specifications. RAD 6.0 supports J2EE 1.4 and integrated with Eclipse 3.0, UML Visual Editor, Tomcat Jakarta, Ant scripting, EJB universal test client and SOA tools.

5. Diff b/w Weblogic and WebSphere?

  Both BEA Weblogic and IBM’s WebSphere provide J2EE based application servers which are competitors. WebSphere leverages more on connectivity issues with MQ and legacy systems with strong dominance in J2EE.

6. What are the different JMS providers available in different WAS versions? 
    
   WAS 6 
   WebSphere Embedded Messaging 
   WebSphere MQ 
   Generic 
               V5 Default Messaging 

                                           WAS 5 
                                           Generic JMS Provider 
                                           WebSphere JMS Provider 
                                           WebSphere MQ JMS Provider 
        

7. What is JavaBean?

  A JavaBean is a Java Object that is serializable, has a nullary constructor, and allows access to properties using getter and setter methods.

8. What is the profile?

  Profiles are a set of files that represent a websphere application server configuration.

9. What is the application server?

  The application server provides a runtime environment in which to deploy, manage, and run j2ee applications.

10. Why use the boostrap port number?

  Client applications use the bootstrap port to access websphere’s built-in object request broker (orb) to use enterprise java beans in applications installed on the application server. The java naming and directory interface service provider url used by the client application needs to reference the bootstrap port to obtain an initial context for looking up ejb’s it wants to use. (For communicate two servers)







WebSphere Application Server Architecture

                                                                                                                            First we need to understand the architecture