Oracle Applications

This article will help to know about the Oracle Applications

Suppose you are running a small grocery shop named “XYZ Grocery”, so the typical operation as a shop owner is you basically buy groceries from some big seller and stock it in your shop. Now people come to your shop for day-to-day needs and buy stuff from your shop at a slightly higher price than what you originally bought and stocked it in your shop. Occasionally you may not be carrying items or run out of stock that people ask for so you make a note of it and promise the person to come back tomorrow and they will get their item. So far so good, now let’s name some entities before we proceed and things get complicated. The big seller from whom you buy stock is called as Vendor or Supplier (Vendors are define in the Purchasing Module), the people who come to your shop to buy things are known as customers (Customer are define in the Receivable Module), the stock in your shop is known as inventory.

So far we have identified few entities that play an active role in your day-to-day operations. As time goes by, your business expands and now you take orders over the phone and provide service to deliver the items to your customers, so you hire people to help you out in maintaining the inventory, do the delivery part and all the necessary stuff to keep the business running smoothly. The people you hire are known as Employees. Employees are define in the HRMS Module.

So in this small shop, you typically manage the bookkeeping activities by hand using a notepad or something similar. Now imagine the same setup on a larger scale where you have more than 1, 00,000 customers, have more than 1000 vendors, have more than 1000 employees and have a huge warehouse to maintain your inventory. Now, it is impossible to manage all that information using pen and paper. And if you try to do that, then your business will come to a sudden stop sign.

 

To facilitate big businesses, companies like Oracle Corporation have created huge software known in the category of ERP (Enterprise Resource Planning) as Oracle Applications. Now coming to think of it, Oracle Application is not one huge software, instead it is a collection of software known as modules (GL, PO, AP, AR or FA etc) that are integrated and talk to each other. Now what is meant by integrated? First let us identify the modules by entities. For e.g. Purchasing and Account Payables deal with the vendors since you typically purchase from vendors and eventually have to pay the dues. Oracle Purchasing handles all the requisitions and purchase orders to the vendors whereas Oracle Accounts Payables handles all the payments to the vendors.

Similarly Oracle Inventory deals with the items you maintain in stock, warehouse etc. Dealing with customers is handled collectively with the help of Oracle Receivables and Oracle Order Management. Order Management helps you collect all the information that your customer is ordering over the phone or web store etc where as Receivables help you collect the money for the orders that are delivered to the customers.

Now who maintains the paychecks, benefits of the 1000 employees? Right! It is managed by Oracle Human Resources. So you get the idea by now that for each logical function there is a separate module that helps to execute and maintain that function.
So all the individual functions are being taken care but how do I know if I am making profit or loss? That’s where integration comes into play. There is another module known as Oracle General Ledger. This module receives information from all the different transaction modules and summarizes them in order to help you create profit and loss statements, reports for paying Taxes etc.

Just to simplify the explanation, when you pay your employees that payment is reported back to General Ledgers as cost i.e. money going out, when you purchase inventory items the information is transferred to GL as money going out, and so is the case when you pay your vendors. Similarly when you receive items in your inventory it is transferred to GL as money coming in, when your customer sends payment it is transferred to GL as money coming in, so all the different transaction modules report to GL (General Ledger) as either “money going in” or “money going out”, the net result will tell you if you are making a profit or loss.

All the equipment, shops, warehouses, computers can be termed as Assets and they are managed by Oracle Fixed Assets. Initially Oracle Applications started as bunch of modules and as time passed by they added new modules for different and new functions growing out of the need for today’s internet world.

So if you come across a module that you are trying to learn and work on, first try to understand what business need it is trying to fulfill and then try to understand what the immediate modules that it interacts with. For e.g. lets say you come across Oracle Cost Management module, you will learn that it helps to maintain the costs of items in your inventory and the immediate modules that it interacts with are Oracle Inventory (of course), Oracle Bills of Material, Order Management and so on..

Some modules description:-

Oracle Purchasing handles all the requisitions and purchase orders to the vendors.

Oracle Payables handles all the payments to the vendors.

Oracle Inventory deals with the items you maintain in stock, warehouse etc.

Order Management helps you collect all the information that your customers order.

Oracle Receivables help you collect the money for the orders that are delivered to the customers.

Oracle Human Resources helps maintain the Employee information, helps run paychecks etc.

Oracle General Ledger receives information from all the different transaction modules or sub ledgers and summarizes them in order to help you create profit and loss statements, reports for paying Taxes etc.

Oracle Fixed Assets All the equipment, shops, warehouses, computers can be termed as ASSETS and they are managed by Oracle Fixed Assets Module.

There are lot of modules keep adding everyday in Oracle Application.

August 13, 2008 Posted by ajai | Apps | | No Comments

Room Mates

I have already completed the 2+yrs of my Professional Career in Mumbai,Pune and now in Bangalore, but one thing I miss terribly is the fun I had during my College(MCA) days.

We were five of us in two rooms; people use to call it a two-room flat. Though three of us were MBA students and the rest MCA, it was never an issue. We belonged to different cities and were considered a menace to others because of the fun we have.

All five of us were away from home for the first time, and made the most of it. It was a lot of fun setting up a new house together. We got to know each other and had good times and some bad time.

They were two fun-filled, unforgettable years I spent. In the third year, the career orientations began, things started to change. every one wanted to do everything.Suresh and Santosh were already placed with some company.Me and Asit were looking for Training for our final semester and Ravindra was some plan to do some business in his home town.

The years flew by and enjoyed every moment — having dinner together, going out for evening walks around and a hundred other things.

I joined my First company as a trainee as soon as our last semester starts, completely unaware of how things would turn out for any of us. Surprisingly, After 2 yrs I’m in Bangalore with Asit, who is in an IT company, and Suresh is in Delhi. This happy coincidence allows us the chance to catch up regularly (thanks to technology).

really miss those day.

July 13, 2007 Posted by ajai | College Days | | 4 Comments

Some EJB Questions

Hi Mayank Thanks for ur valuable comments. I will post the basics of java on my next Blog.

This Blog will be very helpful who are preparing for Sun Certification of EJB. In this blog I have tried to put most of the EJB related questions. Hope it will be useful for u guys all over the java world.

What are the different kinds of enterprise beans?
Different kind of enterrise beans are Stateless session bean, Stateful session bean, Entity bean, Message-driven bean.

What is Session Bean?
A session bean is a non-persistent object that implements some business logic running on the server. One way to think of a session object.

What is Entity Bean?
The entity bean is used to represent data in the database.

What are the methods of Entity Bean?
An entity bean consists of 4 groups of methods, create methods.

What is the difference between Container-Managed Persistent (CMP) bean and Bean-Managed Persistent(BMP) ?
Container-managed persistence (CMP) and bean-managed persistence (BMP). With CMP, the container manages the persistence of the entity bean.

What are the callback methods in Entity beans?
Callback methods allows the container to notify the bean of events in its life cycle. The callback methods are defined in the javax.ejb.EntityBean interface.

What is software architecture of EJB?
Session and Entity EJBs consist of 4 and 5 parts respectively, a remote interface.

Can Entity Beans have no create() methods?
Yes. In some cases the data is inserted NOT using Java application,.

What is bean managed transaction?
If a developer doesn’t want a Container to manage transactions, it’s possible to implement all database operations manually.

What are transaction attributes?
The transaction attribute specifies how the Container must manage transactions for a method when a client invokes the method via the enterprise bean’s home.

What are transaction isolation levels in EJB?
Transaction_read_uncommitted, Transaction_read_committed, Transaction_repeatable_read.

What is EJB Query Language ?
The EJB query language is used to specify a query over container-managed entity beans. The language is similar to SQL. An EJB query is independent of the bean’s mapping to a persistent store.

List out some responsibilities of EJB container.
coordinating system services, controlling threads, managing security and bean lifecycle.

Can file descriptors be used in an EJB application?
No, to avoid any hassles in ejb component distibutability feature file descriptors are disallowed. If allowed a feature like dropping a ear file in different environments with diff operating systems will face a problem as they will have their file hierarchy style.

What are the limitations with regard to Java Reflection in EJB?
In general Java Reflection is allowed in EJB, only those apis which inspect the private or protected variables are disallowed.

Are class loaders allowed in ejb.
Yes only custom class loaders are not allowed.

Are native code allowed in EJB.
No it will cause portability problem so its not allowed.

If EJB specification doesnot allow an EJB to listen to a socket or open a file, can i overcome it by using the helper or dependent classes.
No, any restriction related to EJB also applies to their helper classes.

What is the lifecycle of Entity Bean ?
An entity bean instance is in one of the following THREE states:
1.DOES NOT EXIST state.
2.POOLED state. An instance in the pooled state is not associated with any particular entity object identity.
3.READY state. An instance in the ready state is assigned an entity object identity.

Which one is disallowed in ejb - thread creation or thread management?
Anything related to thread is containers job, so neither creation nor management is allowed. EJB framework is developed to ease the developer from technical aspects and focus on business aspects, so thread creation is controlled by ejb container.

Can we develop a networking application with client socket connections in EJB?
yes we can as long as we dont leave the connection open all the time.

which one is disallowed in EJB reading a file or writing a file?
Both are not allowed as files are not transactional resources, also file hierarchy structure will interfere with the component distributability feature.

Final vs Nonfinal static fields in EJB, which one is allowed and which one is not allowed? reason them.
As Nonfinal static fields cannot be maintained/updated properly in the case of distributed environment its not supported. Final static fields dont have the problem of updation so its allowed. This question is related to runtime distribution problem.

Can we develop a networking application with an EJB acting as a socket listener, if yes how and if no why?
If an EJB is used as a socket listener then it has to be awake all the time listening for incoming calls and so it cannot be passivated. which will not result in being a better system.

 How EJB Invocation happens?
Retrieve Home Object reference from Naming Service via JNDI. Return Home Object reference to the client. Create me a new EJB Object through Home Object interface. Create EJB Object from the Ejb Object. Return EJB Object reference to the client. Invoke business method using EJB Object reference. Delegate request to Bean (Enterprise Bean).

What happens if remove( ) is never invoked on a session bean?
In case of a stateless session bean it may not matter if we call or not as in both cases nothing is done. The number of beans in cache is managed by the container. In case of stateful session bean, the bean may be kept in cache till either the session times out, in which case the bean is removed or when there is a requirement for memory in which case the data is cached and the bean is sent to free pool.

How can I call one EJB from inside of another EJB?
EJBs can be clients of other EJBs. It just works. Use JNDI to locate the Home Interface of the other bean, then acquire an instance reference, and so forth.

What is an EJB Context?
EJBContext is an interface that is implemented by the container, and it is also a part of the bean-container contract. Entity beans use a subclass of EJBContext called EntityContext. Session beans use a subclass called SessionContext. These EJBContext objects provide the bean class with information about its container, the client using the bean and the bean itself. They also provide other functions. See the API docs and the spec for more details.

Can the primary key in the entity bean be a Java primitive type such as int?
The primary key can’t be a primitive type. Use the primitive wrapper classes, instead. For example, you can use java.lang.Integer as the primary key class, but not int (it has to be a class, not a primitive).

What is the advantage of using Entity bean for database operations, over directly using JDBC API to do database operations? When would I use one over the other?
Entity Beans actually represents the data in a database. It is not that Entity Beans replaces JDBC API. There are two types of Entity Beans Container Managed and Bean Mananged. In Container Managed Entity Bean - Whenever the instance of the bean is created the container automatically retrieves the data from the DB/Persistance storage and assigns to the object variables in bean for user to manipulate or use them. For this the developer needs to map the fields in the database to the variables in deployment descriptor files (which varies for each vendor). In the Bean Managed Entity Bean - The developer has to specifically make connection, retrive values, assign them to the objects in the ejbLoad() which will be called by the container when it instatiates a bean object. Similarly in the ejbStore() the container saves the object values back the the persistance storage. ejbLoad and ejbStore are callback methods and can be only invoked by the container. Apart from this, when you use Entity beans you dont need to worry about database transaction handling, database connection pooling etc. which are taken care by the ejb container.

Brief description about local interfaces?
EJB was originally designed around remote invocation using the Java Remote Method Invocation (RMI) mechanism, and later extended to support to standard CORBA transport for these calls using RMI/IIOP. This design allowed for maximum flexibility in developing applications without consideration for the deployment scenario, and was a strong feature in support of a goal of component reuse in J2EE. Many developers are using EJBs locally, that is, some or all of their EJB calls are between beans in a single container. With this feedback in mind, the EJB 2.0 expert group has created a local interface mechanism. The local interface may be defined for a bean during development, to allow streamlined calls to the bean if a caller is in the same container. This does not involve the overhead involved with RMI like marshalling etc. This facility will thus improve the performance of applications in which co-location is planned. Local interfaces also provide the foundation for container-managed relationships among entity beans with container-managed persistence.

What are the special design care that must be taken when you work with local interfaces?
It is important to understand that the calling semantics of local interfaces are different from those of remote interfaces. For example, remote interfaces pass parameters using call-by-value semantics, while local interfaces use call-by-reference. This means that in order to use local interfaces safely, application developers need to carefully consider potential deployment scenarios up front, then decide which interfaces can be local and which remote, and finally, develop the application code with these choices in mind. While EJB 2.0 local interfaces are extremely useful in some situations, the long-term costs of these choices, especially when changing requirements and component reuse are taken into account, need to be factored into the design decision.

What is the difference between Message Driven Beans and Stateless Session beans?
In several ways, the dynamic creation and allocation of message-driven bean instances mimics the behavior of stateless session EJB instances, which exist only for the duration of a particular method call. However, message-driven beans are different from stateless session EJBs (and other types of EJBs) in several significant ways: Message-driven beans process multiple JMS messages asynchronously, rather than processing a serialized sequence of method calls. Message-driven beans have no home or remote interface, and therefore cannot be directly accessed by internal or external clients. Clients interact with message-driven beans only indirectly, by sending a message to a JMS Queue or Topic. Only the container directly interacts with a message-driven bean by creating bean instances and passing JMS messages to those instances as necessary. The Container maintains the entire lifecycle of a message-driven bean; instances cannot be created or removed as a result of client requests or other API calls.

July 10, 2006 Posted by ajai | Knowledge | | 3 Comments

Some java Interview questions

Hello Guys,

This is my first post to the blogger and this blog is for java freshers and persons looking for interviews on next some days.I m posting some usually asked java questions with answers with the hope that this will help you all for the interviews.

My next post will be toughest questions on EJB. feel free to post any comment on this post and let me know which type of help do u want on java side.

Is it necessary to override hashcode whenever equals method is overridden? why? public int hashCode() This method must be overridden in every class that overrides the equals method. Equal objects must produce the same hash code as long as they are equal, however unequal objects need not produce distinct hash codes.

Explain the servlet life cycle?

1. The web container loads the servlet class and create an instance.
2. Then it initializes the servlet instance by calling the init()
3. The service method is called to serve the requests
4. The conatiner finalizes the servlet by calling the destroy method.

What are the limitations with regard to Java Reflection in EJB?

In general Java Reflection is allowed in EJB, only those apis which inspect the private or protected variables are disallowed.

How to access a singleton class?

There should be static method which gives the instance of the singleton class. Call that static method which gives you the instance .Once you have instance you can call the methods in that class. The static method which is giving object is take care of single instance of the object.

What is the ResourceBundle class?

The ResourceBundle class is used to store locale-specific resources that can be loaded by a program to tailor the program’s appearance to the particular locale in which it is being run.

In Java collections HashMap or HashSet, to use as a key, will you prefer a mutable object or immutable object? and why do you prefer?

Hash value is used in identifying objects in Hash collections, to be 100% accurate all the time the hash value should not change. So immutable objects are a perfect solution for this.

Is there any advantage in extending Thread class rather than implementing Runnable interface?

when there is a need to run multiple threads with their own instance variables extending threads makes sensible. Wherein implementing runnable makes sense in single execution models.

what are the differences between UDP and TCP?

UDP (user datagram protocol), is a connectionless protocol.
each time you send datagrams, you also need to send the local socket descriptor and the receiving socket’s addressTCP is a connection-oriented protocol. a connection must first be established between the pair of sockets.

While one of the sockets listens for a connection request (server), the other asks for a connection (client).

Once two sockets have been connected, they can be used to transmit data in both (or either one of the) directions

How does Java handle integer overflows and underflows?

It uses those low order bytes of the result that can fit into the size of the type allowed by the operation.

Int vs Integer which one is mutable and which is immutable?

int is mutable Integer is immutable

Can an interface be declared final? If yes how and if no why?

1. Interfaces cannot be declared final.

2. Interfaces are meant to be implemented,they dont have any code implemented within them.

3. They cannot be instantiated.

In java thread creation models Runnable and Thread, Which one is better why?

By implementing Runnable interface we are free to extend any other class and implement any other interfaces. This gives a strong advantage incase of Runnable interface.

What are the differences between Vector and ArrayList? Which is best to use? ArrayList is faster and also it occupies less memory space whereas vector takes more memory space.

Vector is a synchronized object, while ArrayList is not iterator that are returned by both classes are fail-fast, but the Enumeration returned by Vector are not .

Can you tell some immutable classes in java?

1. The main immutable class is String.

2. Basic numeric classes like Integer, Long, Float, BigInteger and BigDecimal are immutable classes.

Difference between interface and abstract class?

If you know the generic method which you are going to use in all subclasses then implement it in abstract class and leave remaining unknown implementation methods as just declare in the abstract class so the sub classes are going to implement based on their business logic.

More clearly :

Let’s discuss what Interfaces and Abstract Classes are all about to understand the differences between the two more clearly and completely.

Interface: Java Interfaces are equivalent to protocols. They basically represent an agreed-upon behavior to facilitate interaction between unrelated objects. For example, the buttons on a Remote Controller form the interface for outside world to interact with TV. How this interface is implemented by different vendors is not specified and you’re hardly aware of or bothered about how these buttons have been implemented to work internally. Interface is plainly a contract between the producer and the consumer. How the producer implements the exposed behavior is normally not cared by the consumer.

In Java, an Interface is normally a group of methods with empty bodies. You can have constant declarations in a Java Interface as well. A class that implements the interface agrees to the exposed behavior by implementing all the methods of the interface.

interface TVRemoteController{
void power();
void setChannel(int channelNumber);
void upChannel();
void downChannel();
void upVolume();
void downVolume();
……
}

A sample implementation of this interface by a vendor, say Sony:

public class SonyTVRemoteController implements TVRemoteController{
/*…this class can have other methods, properties as well …*/
……
void power(){
//implementation of power() method of the interface
}
void setChannel(int channelNumber){
//implementation of setChannel(int) method of the interface
}
//similarly, implementation of other methods of the interface
……
}

Implementing an interface means the class will support at least the exposed behavior. It can definitely add any number of extra behaviors/properties for its clients. That’s why few Remote Controllers have hell lot of buttons :-)

Abstract Class: In Java, abstract class is a class which has been declared ‘abstract’. By declaring ‘abstract’ we ensure that the class can’t be instantiated. Why to have such a class then? Because, you would not be having implementation of all the methods in that class and you need to leave it to the subclass to decide how to implement them. In this case, there is no point instantiating an incomplete class.

An abstract method is a method which doesn’t have any implementation. If a class has even a single abstract method, then you got to declare the class ‘abstract’. Though, you don’t need to have at least one abstract method to declare a class abstract. You can declare a complete class as ‘abstract’ as well. This practice is seldom used. One possible reason may be that you never want your clients to instantiate your class directly even though you’ve already provided default implementation of all the methods. Strange! Yeah… it is. The designer of such a class may like to provide the default implementation of at least one method just to serve as a template (and not the actual implementation) for the client and thus making the class incomplete. So, a client first needs to subclass and implement the method(s) by overriding them. Now the subclass will be a concrete/complete class. Does it make some sense? Okay… Let me try to give another example. Think of a hypothetical situation, where you need to design a class, which will have ‘n’ methods and ‘n’ clients, where every single client wants default implementation of ‘n-1’ methods and it needs to implement only one (unique to every client) of the methods. In such a situation, you may not like to declare any of the methods ‘abstract’ as it’ll be required to be a non-complete method only for one of the clients and a complete implementation for other ‘n-1’ clients. If you declare it ‘abstract’ then every client will need to implement it and you’ll end up getting ‘n-1’ same piece of code. On the other hand, if you don’t declare ‘abstract’ then you simply need to override this method in corresponding sub class. Since, the base class is incomplete in all the ‘n’ cases. Assuming that this class will have only these many forms of usage, you’ll never require having an instance of it. That’s why you would declare it ‘abstract’. Confused? Read this paragraph once more [:-)]

public abstract class SampleAbstractClass{
//…fields
……
//…non-abstract methods, if any
……
//…abstract method, if any J
abstract void sampleAbstractMethod(); //… ends with ‘;’
}

public class SubClassOfSampleAbstractClass extends SampleAbstractClass{
//… fields, and non-abstract methods (if any)
……
//…implementation of the abstract method
void sampleAbstractMethod(){
……
}
}

Difference between Interfaces and Abstract Classes: From the language perspective, there are several differences, few of them are:-

  • An abstract class may contain fields, which are not ‘static’ and ‘final’ as is the case with interfaces.
  • It may have few (or all) implemented methods as well, whereas Interfaces can’t have any implementation code. All the methods of an interface are by default ‘abstract’. Methods/Members of an abstract class may have any visibility: public, protected, private, none (package). But, those of an interface can have only one type of visibility: public.
  • An abstract class automatically inherits the Object class and thereby includes methods like clone(), equals(), etc. There is no such thing with an interface. Likewise, an abstract class can have a constructor, but an interface can’t have one…
  • Another very famous difference is that Interfaces are used to implement multiple inheritance in Java as a class in Java can explicitly have only one super class, but it can implement any number of interfaces… blah blah… :-)

From the performance perspective, the different is that Interfaces may be little slower as they require extra indirection to find the corresponding method in the actual class. Though, modern JVMs have already made that difference very little.

If you want to add a new method to an interface, then you either need to track all the classes implementing that interface or you’ll extend that interface to make a new interface having that extra method(s). In case of an abstract class, you’ll simply add the default implementation of that method and all the code will continue to work.

Many differences are listed already, but the main difference lies in the usage of the two. They are not rivals, but in most of the cases they are complimentary. We need to understand when to use what.

When to use an Interface: it asks you to start everything from scratch. You need to provide implementation of all the methods. So, you should use it to define the contract, which you’re unsure of how the different vendors/producers will implement. So, you can say that Interfaces can be used to enforce certain standards.

When to use an Abstract Class: it is used mostly when you’ve partial implementation ready with you, but not the complete. So, you may declare the incomplete methods as ‘abstract’ and leave it to the clients to implement it the way they actually want. Not all the details can be concrete at the base class level or different clients may like to implement the method differently.

When to use both: if you want to implement multiple inheritance where you have the luxury of providing partial implementation as well. You’ll then put all that code in an abstract class (this can be a concrete class as well… but here we assume that the class is also only partially implemented and hence an abstract class), extend that class, and implement as may interfaces as you want.

If you don’t know any method implementation at that time declaration then go for interface.

  • Abstract class may contain some fully implemented methods, but in interface one has to implement every method.

  • A class gets the ability to implement multiple interfaces but only one abstract class.

What are the differences between HashMap and Hashtable?

Both provide key-value access to data Access to the Hashtable is synchronized on the table while access to the HashMap isn’t.

Iterator in the HashMap is fail-safe while the enumerator for the Hashtable isn’t.

If you change the map while iterating, you’ll know.

And, a third difference is that HashMap permits null values in it, while Hashtable doesn’t. Also Map allows you to iterate over keys, values, or key-value pairs; Hashtable did not provide the third option.

July 8, 2006 Posted by ajai | Knowledge | | 15 Comments

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

June 16, 2006 Posted by ajai | Uncategorized | | 1 Comment