What is the difference between distributed transactions and flat transactions in ejb?
How do you establish a connection between two ear files
The Connection Pool Manager is used to establish a connection between two ear files.
What are the main performance issues in jboss server?
What are the main metrics we have to monitor in jboss server?
What is the difference between eAR, jar and war file
Answered by jey on 2005-05-08 11:23:41: in j2ee application modules are packaged as eAR, jar and war based on their functionality jar: ejb modules which contains enterprise Java beans class files and ejb deployment descriptor are packed as jar files with .Jar extenstion war web...
JAR : JAVA Archives and it allows aggregating many files into One.It usually hold java classes in lib.
WAR : Web Application Archives and it stores xml,Java Classes and JSP for Web Application.
EAR : Enterprise Archives it combines JAR and WAR files into combined Archives
EAR is an EEnterprise Aapplication archive and may contain ejb JAR files, WAR files, and RAR (connector) files. They may also contain third-party libraries - but you have to know how to manipulate the...
Which method is declared in the sessionbean interface?
ejbActivate
ejbPassivate
ejbRemove
setSessionContext
create() method is declared in the session bean interface.
What is the difference between cmp and bmp
Answered by jey on 2005-05-08 11:32:16: cmp means container managed persistence. When we write cmp bean , we dont need to write any JDBC code to connect to database. The container will take care of connection our enitty beans fields with database. The container manages the persistence of the bean. Absolutely...
Only Difference that in CMP no need to Write Database Connectivity Code And In BMP no need to Write the Code
CMP means Container Managed Persistence. In case of CMP bean , developers dont need to write any JDBC code to connect to Database. The container will take care of connection our enitty beans...
What is the difference between normal Java object and ejb
EJB is a specification to develop JEE applications.
An EJB object is also an java object, but as it follows the EJB Specifications, it can be remotely identified in an Application server. An java object can be deployed in an application server, but can...
remotely hosted scalable/distributed applications/services (which process and/or store/retrieve data) such that the client does not need to execute locally on a single machine.
Webservices are typically any services that can be published over the internet or on a wide range of networks so that the functionality is available to a wider audience..There is a slight differe...
What is the difference between httpsession and stateful session bean
Session Bean comes with the implicit services where as HHTPSession does not.
Session Bean can be web based or can be stand alone where the other can only be web based.
Session Bean can be used for multiple operation for a single HTTP request but the other cannot.
From a logical point of view, a Servlet/JSP session is similar to an EJB session. Using a session, in fact, a client can connect to a server and maintain his state. But, is important to understan...
RequestDispatcher is a class having forward(req,res) & include(req,res) methods
Can I invoke runtime.Gc() in an ejb
Answer posted by mohan on 2005-05-21 19:26:48: no
Hi,We can call Runtime.gc() explicitly as you (all) described. But some time "May be usefull". Otherwise "No Use". When ?. Note that If we call garbage collection explicitly, this "WILL NOT GARBAGE CO...
no we cannot invoke Runtime.gc() in an EJB
Because Enterprise Beans doesn,t need to call gc.
What is the difference between Javabean and ejb
Answer posted by mohan on 2005-05-20 08:40:04: Java beans is intra-process component where as ejb is an inter-process component Javabeans is particularly well-suited for asynchronous, intra-application communications among software
JavaBean :1. Low-level approach for developing re-usable components for building different Java applications (Applets, stand-alone applications etc.).2. Java Beans runs in a JVM, just like other norma...
JavaBeans- are reuseable,non-deployable components. They can't exist independently.EJB - are deployable, reuesable, server side components. They can exist independently or in integration with other components.
Wait(), notify() and notyfyall() methods
Why wait(), notify() and notyfyall() methods are avialble in object class but not in thread class? Explain.
Answered by: janswain
Member Since Sep-2008 | Answered On : Sep 25th, 2008
Each object in java is associated with a lock and the wait and notify methods are not associated with a thread but with a lock, so coupling locks and objects meant that each object should have wait and notify methods that operate on that object’s lock.
Java provides a way to lock the code for a thread which is currently executing it using the synchorinized keyword, and making other threads that wish to use it wait until the first thread is finished.These other threads are placed in the waiting state .Once the first thread completes it task than it notifies others in the queue by giving the lock to JVM.Now JVM decides which thread will exceute next by its internal algo.Hence, the wait and notify methods has to be in Object class as it acquires lock and has to notify others.....
A thread having a lock on the shared object (by using synchronized constructs) can invoke these methods on that shared Object. It gives a hint to JVM scheduler to pick or block the next thread contend...
A lock is done on an object. It is an obect which is locked, hence these methods are characteristics of the object, hence defined in the Object class.
You have two option.
If the EJB is local (in the same EAR) you will use @EJB
If the EJB outside ear you will lookup in Application server context.
First approach is also correct. But in that approach you have use narrow method whereas in this case you dont need it. By using this approach also we can call EJB from a jsp initalContext ic=...
J2EE app servers give freedom to the developer/ application deployer/ end user from vendor lockin. As far as software development is concerned, such ass servers gives flexibility in choosing between d...
Enterprise JavaBeans (EJBs) contain the application's business logic and live business data. Although it is possible to use standard Java objects to contain your business logic and business data, usin...
Distributed object using rmi-iiop
How are parameters passed to a method of a distributed object using rmi-iiop?
The parameters which are passed to remote methods will be a copy of the actual parameter objects. The basic rule is that the parameters should be Serializable or primitives. The remote JVM will get an exact copy of the objects being passed as parameters from the client JVM.
In remote calls, parameters passed by value not by reference.
Why an onmessage call in message-driven bean is always a seperate transaction
Message driven beans cannot be instantiated by a client application. The container creates the mdb instantiates an mdb each time a message is available on a jms queue. Hence by default each message is...
The MDB is stateless and inherently each message is unique with respect to the MDB.
Each message needs to be processed independently. Hence the need for separate transactions
How do you check whether the session is active in stateful session bean
Use the callback methods ejbActivate() and ejbPassivate() to throw a user-defined message whenever the container calls these methods to activate or passivate a stateful session bean instance.
In Stateful session bean session is not itself a separate entity. it is contained in the bean it self. So in order to check tht we need the check whether the Stateful session bean is present or not which is done by just invoking the home interface with the jndi
Answered by jey on 2005-05-08 17:27:45: acid is releated to transactions. It is an acronyam of atomic, consistent, isolation and durable. Transaction must following the above four properties to be a better one atomic: it means a transaction must execute all or nothing at all. consistent:...
A - AtomocityC - ConsistencyI - IsolationD - Durability.When Transactoon(Tx) middleware service is enabled on the Businesslogic the data on the application available outside or in DB s/w&nbs...
Atomic-- should execute all or nothing...rollback come into picture Consistent--Consistency is a transactional characteristic that must be enforced by both the transactional system and the applic...
EJB is a distributed technology i.e capable of developing java based distributed applications, enterprise application & heavy weight business component giving the advantages of readyma...
EJB is an server side component & its a WODA ( Write Once Deploy Any Where).
EJB's run will under the control of EJB container.
EJB is popular due to System level services provided by it.
Developer can more concentrate on Business Logic due to services provided byu EJB.
thanks.
A nested transaction is a transaction that is logically decomposed into the hierarchy of sub transaction.
A distributed transaction that is logically flat, indivisible transaction that operates on distributed data
Distributed transaction are executed in a distributed manner (may on more than one machine) while flat are not having this feature.