Transaction rollback in stateless session EJB 3.0
Hello everyone !
I have a stateless session EJB as per 3.0 spec.
/*Remote Interface*/
package com.nseit.ncfm2.data.ejb;
import java.sql.SQLException;
import java.util.Collection;
import javax.ejb.Remote;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.naming.NamingException;
import com.nseit.ncfm2.security.Audit;
@Remote
public interface ProductionDataChangesRequestsRemote {
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public boolean shiftCandidateDetails(String sourceNcfmId,
String destinationNcfmId, Collection<String> specialCasesList, String shiftingRemarks, String user, Audit updtAudit) throws NamingException, SQLException;
/*Bean Class*/
package com.nseit.ncfm2.data.ejb;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.ejb.TransactionManagement;
import javax.ejb.TransactionManagementType;
import javax.naming.NamingException;
import com.nseit.ncfm2.security.Audit;
import com.nseit.ncfm2.util.server.lookup.LookUpServerResources;
import java.sql.*;
import java.util.*;
* Session Bean implementation class ProductionDataChangesRequestsBean
@Stateless(name = "ProductionDataChangesRequestsBean", mappedName = "ProductionDataChangesRequestsEJB")
@Remote(ProductionDataChangesRequestsRemote.class)
@TransactionManagement(TransactionManagementType.CONTAINER)
public class ProductionDataChangesRequestsBean implements
ProductionDataChangesRequestsRemote {
* Default constructor.
public ProductionDataChangesRequestsBean() {
// TODO Auto-generated constructor stub
@Override
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public boolean shiftCandidateDetails(String sourceNcfmId,
String destinationNcfmId, Collection<String> specialCasesList,
String shiftingRemarks, String user, Audit updtAudit)
throws NamingException, SQLException {
// TODO Auto-generated method stub
Connection conn = null;
PreparedStatement pstmt = null;
int updtCnt = 0;
boolean areDetailsShifted = false;
try {
/* Start: update table-1 */
updtCnt = pstmt.executeUpdate();
/* End: update table-1 */
/* Start: update table-2 */
updtCnt = pstmt.executeUpdate();
/* End: update table-2 */
areDetailsShifted = true;
} /*catch (SQLException e) {
// TODO Auto-generated catch block
System.out
.println("SQLException in ProductionDataChangesRequestsBean.shiftCandidateDetails(...) "
+ e.getMessage());
// e.printStackTrace();
context.setRollbackOnly();
} */finally {
LookUpServerResources.closeStatement(pstmt);
LookUpServerResources.closeConnection(conn);
return areDetailsShifted;
Currently,if the 1st table update succeeds and the 2nd table update gives an exception,a rollback is not taking place i.e records in 1st table are updated.
I want the transaction to be rolled back in case an SQLException occurs(or for that matter,any runtime exception occurs).
I tried two approaches :
i: Use of context.setRollbackOnly() in catch block for SQLException
ii:Throwing the SQLException
In both the cases, the transaction didn't roll back.
How can I achieve this :
i: Without the usage of @ApplicationException annotation(as I do not have any application exceptions)
ii: Without catching the SQLException and then calling context.setRollbackOnly()
Or what is the standard way?
Thanks !
Where is your connection object coming from?
Similar Messages
-
Transaction management in stateless session beans.
Hi all,
I am using EJB 1.1.
I have a statless session bean that has two methods- A and B.
which does not involve any database interaction
like inserting/updating/deleting the data in the database.
The process flow is such the client always calls A first followed by the call to B.
I have the Transaction attribute set as TX_REQUIRED at the whole bean level.
Now my question is as follows:
Since it is a stateless bean, ejbCreate() is called for every method's invocation.
So does it mean that a new transaction is started for every method invocation?
Also since a transaction ends by commit/rollback.
The transation associated with the method A/B will never get completed as there is no commit/rollback involved in method implementation.
So how is this transaction ended?
Any more details about the transaction management in stateless session beans is highly appreciated.
Any input at the earliest is highly appreciated.
Thanks in advance.Since it is a stateless bean, ejbCreate() is called for every method's invocation.For stateless session bean , Create() is not delegated to the instance.
So does it mean that a new transaction is started for every method invocation?This depends opon the Tx attribute and sequence of calls. Since you have given Tx_required then if you call any method and there is no Tx context associated with client,then a new TX will be started by container othere wise it will execute in the same TX context as the calling client. Note that client can be jsp or other ejb method.
Also since a transaction ends by commit/rollback.
The transation associated with the method A/B will never get completed >as there is no commit/rollback involved in method implementation.
So how is this transaction ended?If you are using COntainer managed TX then Transaction handling like starting , ending etc is handled by the container. You need not worry about that.
Any more details about the transaction management in stateless session >beans is highly appreciated.
Any input at the earliest is highly appreciated.Some time back I had read the article on how the Transaction management done by container on IBM Site. I dont have URL , but you can search the site.
HTH
-Ashwani -
Stateless session EJBs & "idempotent"
We need to declare a method as "idempotent" to take care of failure inside a
method call, For that to work the code inside should written in such way so
that repeated call to the same method should not give us diffrent result.
But why can't weblogic implement a partial rollback( Just like Oracle's save
point rollback, where you can rollback to certain point within a
transaction).
Because some times it is not possible to code in such a way to get the same
result every time(Incase of fail over)
Thanks
,Stateless session EJBs
Stateless session EJBs can have both a cluster-aware home stub and a
replica-aware EJBObject stub. By default, WebLogic Server provides failover
services for EJB method calls, but only if a failure occurs between method
calls. For example, failover is automatically supported if there is a
failure after a method completes, or if the method fails to connect to a
server. When failures occur while an EJB method is in progress, WebLogic
Server does not automatically failover from one server to another.
This default behavior ensures that database updates within an EJB method are
not "duplicated" due to a failover scenario. For example, if a client calls
a method which increments a value in a datastore and WebLogic Server fails
over to another server before the method completes, the datastore would be
updated twice for the client's single method call.
If methods are written in such a way that repeated calls to the same method
do not cause duplicate updates, the method is said to be "idempotent." For
idempotent methods, WebLogic Server provides the
stateless-bean-methods-are-idempotent deployment property. If you set this
property to "true" in weblogic-ejb-jar.xml, WebLogic Server assumes that the
method is idempotent and will provide failover services for the EJB method,
even if a failure occurs during a method call.
Vishal,
I wouldn't think you would have a problem doing RMI communication from a Entity
Bean - - for instance, when a WLS instance 'hosts' an EJB that communicates to
a different WLS instance that 'hosts' an EJB that communication occurs via RMI.
Chuck Nelson
Developer Relations Engineer
BEA Technical Support -
Stateless Session EJB hangs using URLConnection but WLS doesn't clean up
Hi
We have a stateless session EJB running under WLS 5.1 with service
pack 10 on Solaris.
The bean calls a remote HTTP server using the java.net.URLConnection
class and forwards the response to the EJB client. The bean is largely
working fine but some threads hang waiting on the HTTP response. Debug
statements, which are written immediately after the response has been
read and the connection has been closed, do not appear in our log for
the hung threads. The WebLogic Console displays these threads as "in
use" and a "netstat -an" displays the tcp connections as ESTABLISHED.
However, the access logs of the remote Apache server show the HTTP
connections of the threads in question completed successfully with
HTTP code 200. The Apache server is using keep-alive connections.
Some EJB threads are still waiting for something it seems.
Has anyody else experienced this when using URLConnection from
stateless session EJBs under WLS?
The second problem is why doesn't WLS time these threads out after
trans-timeout-seconds (we're using the default of 300 seconds)? The
WLS log shows no error messages relating to this problem.
I'm grateful for any info offered.
Thanks in advance
SteveIf you suspect that WLS protocol handler is at fault (and quite often it is),
one thing to try is (if you use Sun's JVM) to use Sun's HTTP protocol handler
instead of WLS (the most common symptom is when code which makes HTTP requests
works fine outside of WebLogic and you have problems getting it to work inside
WebLogic) :
replace
URL url = new URL("http://...");
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
with
URL url = new URL(null, "http://...", new sun.net.www.protocol.http.Handler());
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
You will have to edit weblogic.policy to allow your code to specify protocol
handler.
Also note that transaction timeout is only checked on method boundaries, or
when your code attempts to do something with the database - it is not going to
interrupt thread which is waiting for HTTP response.
Steve Lock <[email protected]> wrote:
Hi
Thanks for the info. The remote HTTP server's access log shows that
the requests were successfully processed. Doesn't this mean that the
connection is then closed? I know the web server is using keep-alive
connections but I thought this was transparent to the client...?
Also why doesn't WLS remove the hung threads?
Steve
"Ignacio G. Dupont" <[email protected]> wrote in message news:<[email protected]>...
We have had a problem like yours with Weblogic 6.1 SP2 on Linux
The problem is sun's implementation of the HTTP connections doesn't have a
timeout, so if the other peer doesn't close the connection your threads will
be "locked" on the connection.
We have found searching the web that the Jakarta project has a package
called Jakarta commons that implements HTTP connections with an
setSoTimeout(int timeout) method so you can open the connections with your
desired timeout. You have to download the code from the CVS as the released
version doesn't support the timedout sockets yet.
When support for the JDK 1.4 version will be announced by Bea you could use
one of its new features that will allow you to pass arguments to the JVM to
specify the maximum socket connection stablising timeout and the max
inactivity on the socket too.
Hope it helps you.
Dimitri -
Error during deployment of stateless session EJB using EJB 3.0
having trouble deploying a stateless session bean to app server 10.1.3.1 oc4j container.
deceided to go through oracles demo: How-To Develop a Stateless Session EJB using EJB 3.0 (http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-ejb30-stateless-ejb/doc/how-to-ejb30-stateless-ejb.html).
the demo encounters the same issue. so i assume there is something wrong with the app server set up, and not my source code.
here is the deployment log:
[Jul 1, 2009 11:59:25 AM] Application Deployer for test_ws STARTS.
[Jul 1, 2009 11:59:25 AM] Copy the archive to C:\product\10.1.3.1\OracleAS_1\j2ee\home\applications\test_ws.ear
[Jul 1, 2009 11:59:25 AM] Initialize C:\product\10.1.3.1\OracleAS_1\j2ee\home\applications\test_ws.ear begins...
[Jul 1, 2009 11:59:25 AM] Unpacking test_ws.ear
[Jul 1, 2009 11:59:25 AM] Done unpacking test_ws.ear
[Jul 1, 2009 11:59:25 AM] Initialize C:\product\10.1.3.1\OracleAS_1\j2ee\home\applications\test_ws.ear ends...
[Jul 1, 2009 11:59:25 AM] Starting application : test_ws
[Jul 1, 2009 11:59:25 AM] Initializing ClassLoader(s)
[Jul 1, 2009 11:59:25 AM] Initializing EJB container
[Jul 1, 2009 11:59:25 AM] Loading connector(s)
[Jul 1, 2009 11:59:26 AM] Starting up resource adapters
[Jul 1, 2009 11:59:26 AM] Processing EJB module: ejb30ws-ejb.jar
[Jul 1, 2009 11:59:26 AM] application : test_ws is in failed state
[Jul 1, 2009 11:59:26 AM] Operation failed with error: java.lang.NoClassDefFoundError
the opmn log reveals the same error, but no more detail.
any ideas???
/stuckI am having exactly the same issue. Was this issue resolved? If so, please share the resolution and if not can someone please suggest what could be wrong.
Thanks -
Private field in a stateless session EJB
Hi guys,
I have a question about the design of a stateless session EJB.
I would like to know :
Does it make sense to put a private field in a stateless session bean???
Imagine the following sitiation:
I have a stateless session bean.
Its job is to delegate the clients calls to some services (Java objects).
These services are held in the private field and instatiated when WebLogic invokes
the ejbCreate method.
So I would like these services (Java objects) be instantiated before the clients
invoke the bean's method for delegation - I mean, when WebLogic
decides to create beans and put it in the pool (on the server startup for example).
But what happens when the same bean once having finished its job is used by a
different client???
Are the services once instatiated available to the new client or WebLogic invokes
the ejbCreate() method and the services are instatiated one more time???(which
would be a performence killer)
I must mention that in order to make the instatiation of the services possible,
I presume I must implement the ejbCreate() method on the bean implementation class
which invokes a private method doing the instatiation.
So, do you think these design is a good design and what is its impact on the performence
of the stateless session EJB ???
Thank you.
FreddyRob Woollen <[email protected]> wrote:
Freddy wrote:
Hi guys,
I have a question about the design of a stateless session EJB.
I would like to know :
Does it make sense to put a private field in a stateless session bean???
Sure
Imagine the following sitiation:
I have a stateless session bean.
Its job is to delegate the clients calls to some services (Java objects).
These services are held in the private field and instatiated when WebLogicinvokes
the ejbCreate method.
So I would like these services (Java objects) be instantiated beforethe clients
invoke the bean's method for delegation - I mean, when WebLogic
decides to create beans and put it in the pool (on the server startupfor example).
But what happens when the same bean once having finished its job isused by a
different client???
Are the services once instatiated available to the new client or WebLogicinvokes
the ejbCreate() method and the services are instatiated one more time???(which
would be a performence killer)
WLS keeps the bean instances around in a pool. See
http://edocs.bea.com/wls/docs81/ejb/session.html#1118700
I must mention that in order to make the instatiation of the servicespossible,
I presume I must implement the ejbCreate() method on the bean implementationclass
which invokes a private method doing the instatiation.
So, do you think these design is a good design and what is its impacton the performence
of the stateless session EJB ???It's fine and a pretty common pattern.
-- Rob
Thank you.
Freddy
Thank you very much Rob.
Freddy -
Stateless Session EJB "Wait???"
I need to let a Stateless Session EJB wait until 2:00 AM before it runs. How can I do that? I don't want to use a loop since it will eat up all system computing resource.
Thanks
KennyIs that a way to code it? I don't want to use existing class. I need to control the EJB itself to "wait" for some time to run.
Thanks
Kenny -
Stateless Session EJB Bean Example please
Dear Friends,
Develop a stateless session EJB bean and deploy it in WebLogic 8.1
Please proivde me a weblogic8.1 example along with the deployment steps.
Also mention the supporting softwares needed.
I have weblogic 8.1, JDK 1.5
Advance Thanks.
Rengaraj.RHi Rahul,
Please paste the files here if they are small in size.
IDfLoginInfo li = new DfLoginInfo(); //this is where the error occurs as when i remove this line. i dont get an error
Have you checked this as I have mentioned something regarding this in my mail?
Regards
Vicky -
Stateless session EJB invoke RMI
Is it possible to invoke RMI calls from stateless session EJBs. It is my understanding
restrictions exists like opening socket, file io, .. are not permitted from EJBs.
Is there a way around.Vishal,
I wouldn't think you would have a problem doing RMI communication from a Entity
Bean - - for instance, when a WLS instance 'hosts' an EJB that communicates to
a different WLS instance that 'hosts' an EJB that communication occurs via RMI.
Chuck Nelson
Developer Relations Engineer
BEA Technical Support -
Servicegen for stateless session EJB
I've run into some minor trouble when I tried to generate
web services for some stateless session EJBs with the
servicegen Ant method. Note that expandMethods has been
set to True. It appears that the generated web-services.xml
file contains methods from the EJB's remote interface. When
deploying the web service WLS will use the locale interface.
If the remote interface has methods not found in the local
interface WLS will refuse to deploy the web service. No big
deal, since I could just add the missing methods to the
local interface. But still, I think this is somewhat odd
and inconsistent behavior. Is there anyway to get WLS to
deploy the web services against the remote interfaces, or
is this just a bad idea?
/BjörnFurther information:
According to metalink bug 3224465, this was a bug fixed in release 9.0.2.3.99 of the App Server. However, I am using 9.0.3.1 and still have the problem.... -
We are writing a J2EE application and using Weblogic 5.1 on Unix machine. We are
considering writing some Stored Procedures or Triggers on Oracle DBMS. Hence our
Stateless Session Beans / Data Access Objects (DAOs) would be calling those stored
procedures, which would reside on Oracle 8.1.7 (on Windows 2000). (These Data
Access Objects are running under the umbrella of a Stateless Session Beans). We
are using WebLogic's Connection Pooling.
Our question is: Would we get reliable rollbacks from our stored procedures. I
mean would the Transaction Management process of the EJB container work. Remember
the SQL is written in the Database (Oracle in this case) in the form of Stored
Procedures / Triggers through PL/SQL.
Any ideas or tips would help.
I would agree with Cameron Purdy. Be very cautious to use Oracle specific
Triggers / Stored Procedures. Consider following, (apart from what he said):
1. Unreliable behaviour of the Oracle JDBC drivers, specially 8.1.6 family..
(You may visit the Oracle's web site and see the newsgroups for the JDBC drivers).
This is enough of a reason to stop right there.
However for interest sake you may consider following issues:
2. By use of Oracle specific Triggers / SPs the application will not be portable.
Vendor Lock In. Remember your choice for J2EE compliant Server (WebLogic in this
case). The whole purpose would be defeated by going for this option.
3. There are issues related to the extensibility of the application. I have
my reservations and would hold my breath on two phase commit protocol transactions
being reliable in this scenario.
Have fun...
Terry
"Cameron Purdy" <[email protected]> wrote:
>Yes, the work performed by the SPs and the triggers would be in the same
>tx.
>
>What would NOT work is if the data has been read into WebLogic and then
>it
>gets affected by a trigger or SP on the RDBMS, the data in WebLogic is
>not
>automatically re-read within that same tx so you need to be careful.
>
>Peace,
>
>--
>Cameron Purdy
>Tangosol Inc.
>Tangosol Coherence: Clustered Coherent Cache for J2EE
>Information at http://www.tangosol.com/
>
>
>"Ahmad" <[email protected]> wrote in message
>news:[email protected]...
>>
>> We are writing a J2EE application and using Weblogic 5.1 on Unix machine.
>We are
>> considering writing some Stored Procedures or Triggers on Oracle DBMS.
>Hence our
>> Stateless Session Beans / Data Access Objects (DAOs) would be calling
>those stored
>> procedures, which would reside on Oracle 8.1.7 (on Windows 2000). (These
>Data
>> Access Objects are running under the umbrella of a Stateless Session
>Beans). We
>> are using WebLogic's Connection Pooling.
>> Our question is: Would we get reliable rollbacks from our stored
>procedures. I
>> mean would the Transaction Management process of the EJB container
>work.
>Remember
>> the SQL is written in the Database (Oracle in this case) in the form
>of
>Stored
>> Procedures / Triggers through PL/SQL.
>> Any ideas or tips would help.
>
>
-
Deploy multiple instances of the same stateless session EJB
I have a stateless session bean.
The methods on the bean operate against DB tables.
Q: Can I deploy multiple instances of the same stateless session bean, but specify a different JNDI/datasource name in the deployment descriptor?
The method calls are all enclosed within a single invocation, just that I need to hit different databases (all with the same schema), and Id like to be able to lookup the EJB via a different JNDI name, and have the exact same functionality, just against different deployed datasources.
Does the spec allow/support this?
If not, any suggestions as to how to achieve this sort of functionality?
Im using JBoss 3.2.1 on Solaris, so Im not sure whether or not this is a JBoss "issue" or a limitation of the EJB Spec (or me being just plain wrong and trying to do something the "wrong way")
NickI have a stateless session bean.
The methods on the bean operate against DB tables.
Q: Can I deploy multiple instances of the same
stateless session bean, but specify a different
JNDI/datasource name in the deployment descriptor?
The method calls are all enclosed within a single
invocation, just that I need to hit different
databases (all with the same schema), and Id like to
be able to lookup the EJB via a different JNDI name,
and have the exact same functionality, just against
different deployed datasources.
Does the spec allow/support this?
If not, any suggestions as to how to achieve this sort
of functionality?
Im using JBoss 3.2.1 on Solaris, so Im not sure
whether or not this is a JBoss "issue" or a limitation
of the EJB Spec (or me being just plain wrong and
trying to do something the "wrong way")
NickI haven't done it but judging from the deployment descriptors yes.
For example if I have two bounded datasources java:/Database1 and java:/Database2
Lets say I have a session bean called MySession, then in your ejb-jar.xml you would have (notice that the desc, display, and ejb-name are the only differences)
<session>
<description>MySessionAlpha</description>
<display-name>MySessionAlpha</display-name>
<ejb-name>MySessionAlpha</ejb-name>
<home>com.mycorp.MySessionRemoteHome</home>
<remote>com.mycorp.MySessionRemote</remote>
<local-home>com.mycorp.MySessionLocalHome</local-home>
<local>com.mycorp.MySessionLocal</local>
<ejb-class>com.mycorp.MySessionFacadeBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
<res-ref-name>jdbc/DataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</session>
<session>
<description>MySessionBeta</description>
<display-name>MySessionBeta</display-name>
<ejb-name>MySessionBeta</ejb-name>
<home>com.mycorp.MySessionRemoteHome</home>
<remote>com.mycorp.MySessionRemote</remote>
<local-home>com.mycorp.MySessionLocalHome</local-home>
<local>com.mycorp.MySessionLocal</local>
<ejb-class>com.mycorp.MySessionFacadeBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
<res-ref-name>jdbc/DataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</session>
But now in the jboss.xml, we will have the following elements. What you may notice is that are bound to different remote and local jndi names. But the resource bindings are very different. The res-ref-name stays the same, but the jndi-name are different. I think this will work for you.
<session>
<ejb-name>MySessionAlpha</ejb-name> <jndi-name>ejb/com/mycorp/MySessionAlphaRemoteHome</jndi-name> <local-jndi-name>ejb/com/mycorp/MySessionAlphaLocalHome</local-jndi-name>
<resource-ref>
<res-ref-name>jdbc/datasource</res-ref-name>
<jndi-name>java:/Database1</jndi-name>
</resource-ref>
</session>
<session>
<ejb-name>MySessionBeta</ejb-name> <jndi-name>ejb/com/mycorp/MySessionBetaRemoteHome</jndi-name> <local-jndi-name>ejb/com/mycorp/MySessionBetaLocalHome</local-jndi-name>
<resource-ref>
<res-ref-name>jdbc/datasource</res-ref-name>
<jndi-name>java:/Database2</jndi-name>
</resource-ref>
</session> -
Stateless session EJB as Web service adds root context prefix in embedded
Hi,
In JDeveloper 10.1.3.1 production (I'm pretty sure it didn't do it in the developer preview), if I run up a stateless session bean surfaced as a web service, then the root context gets prefixed with EJB- e.g. my application context is "services", so deployed to SOA suite the url is of the form:
http://localhost:8888/services/webservice?WSDLbut if I run it up in embedded OC4J in JDeveloper, the URL is:
http://localhost:8888/EJB-services/webservice?WSDL(I'm running embedded on port 8888 too to make deploy easier)
which is causing a huge headache having to change loads of references to web services when moving between development, and deploy for test.
I've tried mucking around no-end with J2EE application properties to get rid of the EJB- prefix, to no end, any help much appreciated.
Cheers.Thanks for the reply.
Afraid the context is just defined as services.
I've done a bit more investigation, and if I simply run/debug the application, and it gets deployed under the default current-workspace-app, then the context gets the EJB- prefix. If I run up the embedded OC4J and manually deploy the application into it, then a new application (services) is created, and the context is correct (although I've now got the application deployed automatically under current-workspace-app, and manually under services, and so both URI's above now obviously work).
This is probably a useable work-around, but still doesn't feel quite right.
Cheers. -
How is remote stateless session EJB removed, if clients don't remove() it
I've seen code that doesn't call .remove, and Sun's tutorial also doesn't .remove(), despite the fact that the create() call is made:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/EJB4.html#wp79902
My questions are:
1. .create() instantiates a new remote instance, doesn't it?
2. since clients don't call .remove(), how does the remote instance get ejbRemove()d?
2.1. Does perhaps the home instance of such ejb cause removal upon finalize()? I've seen some auto-generated EJB stubs, but i don't see that being the case.Clients do have the option of calling remove() but the behavior depends on the kind of
session bean.
For stateless session beans, calling remove() doesn't have much value since the lifetime
of the bean instances in the container is decoupled from the client. An ejb container
is free to use the remove call as a hint, but in general the container will clean up instances
when it deems it necessary. Most implementations define a number of configuration
parameters to control this, e.g., max-pool-size.
For stateful session beans, calling remove() will indeed remove that session bean identity,
whether it's in memory or it has been passivated. Even in the absence of an explicit
client call to remove(), the container is still free to remove a stateful session bean.
Most implementations define a set of timeout parameters that control this behavior.
--ken -
Error running "Develop a Stateless Session EJB Web Service using EJB 3.0"
Running this "how-to," the build and deploy worked fine for me, but when I ran "ant run," I got:
[echo] -----> Setting up the application client module
[oracle:genProxy] null, WSDLException: faultCode=INVALID_WSDL: The document: http://localhost:8888/ejb30ws/ejb30ws?wsdl is not a wsdl file or does not have a root element of "definitions" in the "http://schemas.xmlsoap.org/wsdl/" namespace or the "http://www.w3.org/2004/08/wsdl" namespace.Debu,
Yes, it successfully deployed.
Here are the messages from the failed run.
BUILD SUCCESSFUL
Total time: 33 seconds
D:\Oracle_ejb3.0\demo\howtoejb30ws>ant run
Buildfile: build.xml
common:
[echo] BuildName: ejb30ws
[echo] BuildHome: D:\Oracle_ejb3.0\demo\howtoejb30ws
[echo] BuildFile: D:\Oracle_ejb3.0\demo\howtoejb30ws\build.xml
[echo] BuildJVM: 1.5
oracle-env-check:
java-env-check:
init:
[echo] -----> Initializing project properties
setup:
[echo] -----> Creating the required sub-directories
cli-setup:
[echo] -----> Setting up the application client module
[oracle:genProxy] null, WSDLException: faultCode=INVALID_WSDL: The document: http://localhost:8888/ejb
/ejb30ws?wsdl is not a wsdl file or does not have a root element of "definitions" in the "http://schem
mlsoap.org/wsdl/" namespace or the "http://www.w3.org/2004/08/wsdl" namespace.
[oracle:genProxy] WSDLException: faultCode=INVALID_WSDL: The document: http://localhost:8888/ejb30ws/e
ws?wsdl is not a wsdl file or does not have a root element of "definitions" in the "http://schemas.xml
.org/wsdl/" namespace or the "http://www.w3.org/2004/08/wsdl" namespace.
BUILD FAILED
D:\Oracle_ejb3.0\demo\howtoejb30ws\build.xml:316: oracle.j2ee.ws.common.tools.api.WsdlValidationExcept
null, WSDLException: faultCode=INVALID_WSDL: The document: http://localhost:8888/ejb30ws/ejb30ws?wsdl
not a wsdl file or does not have a root element of "definitions" in the "http://schemas.xmlsoap.org/ws
namespace or the "http://www.w3.org/2004/08/wsdl" namespace.
Total time: 3 seconds
D:\Oracle_ejb3.0\demo\howtoejb30ws>
Maybe you are looking for
-
APN Settings automatically changed
After putting the new settings in API it changed after a period to Vodafone settings automatically, this thing happens constantly. iPad (3rd gen) Wi-Fi + Cellular OS: 5.1.1
-
What is the host string value?Oracle8 Personal
What is the value for the host string field in the log-in dialog box for SQL Plus. I do know my username and password, what do I enter into the hoststring.This is for Oracle8 Personal Ed. on Ms 2000 Platform.
-
Replacing the internal DVD reader with a DVD Writer
Hey there, I have a G4 mac tower at home. I want to replace the DVD reader currently intalled with an internal DVD writer. Can I just go to Best Buy and purchase any internal DVD writer or is there something specific I need to look for? Thanks
-
EXcel to tab delimited text file
I am saving an excel file into a tab delimited text file so that i can use it for uploading data. The excel file contains a text field in which there is a comma ',' . for all the fields which has a comma in the excel file the text file is adding dou
-
MacOS X San Array support on Xserve Intel
Hello, We have a datacenter with several XServe Intel connected to XServe RAID using FC (for Apple file sharing services). A part of the datacenter is migrating to VMware ESX. The XServe RAID cannot be used under VMware (no official support and perfo