Clustering with automatic failover of entity beans? (Provided by any vendors)
Do any vendors provide for clustering with automatic failover of entity
beans? I know that WLS does not. How about Gemstone? If not is there
a reason why it is not possible?
It seems to me that EJB servers should be capable of automatic failover
of entity beans.
dan
Sorry I meant to send this to the ejb newsgroup.
dan
dan benanav wrote:
> Do any vendors provide for clustering with automatic failover of entity
> beans? I know that WLS does not. How about Gemstone? If not is there
> a reason why it is not possible?
>
> It seems to me that EJB servers should be capable of automatic failover
> of entity beans.
>
> dan
Similar Messages
-
Weblogic7/examples/clustering/ejb Automatic failover for idempotent methods ?
This one should be easy since it is from the examples folder of bea 7 about
clustering.
Ref : \bea7\weblogic007\samples\server\src\examples\cluster\ejb
I am referring to the cluster example provided with the weblogic server 7.0
on windows 2000.
I deployed Admin server and 2 managed server as described in document.
Everything works fine as shown by the example. I get load balancing and
failover both. Too Good.
Client.java is using the while loop to manage the failover. So on exception
it will go thru the loop again.
I understand from the documentation that the stateless session EJB will
provide the automatic failover for Idempotent stateless bean
Case Failover Idempotent : ( Automatic )
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.
Now I made 2 changes to the code.
1 . I added as follows to the weblogic-ejb-jar.xml of teller stateless EJB
<stateless-clustering>
<stateless-bean-is-clusterable>true</stateless-bean-is-clusterable>
<stateless-bean-load-algorithm>random</stateless-bean-load-algorithm>
<stateless-bean-methods-are-idempotent>true</stateless-bean-methods-are-idem
potent>
</stateless-clustering>
So I should get the automatic failover .............
2. Also I added the break statement in the catch on line around 230 in
Client .java
catch (RemoteException re) {
System.out.println(" Error: " + re);
// Replace teller, in case that's the problem
teller = null;
invoke = false;
break;
So that the client program does not loop again and again.
Now I compile and restart all my three servers and redeploy application (
just to be sure )
I start my client and I get a automatic load balancing between the server
which makes me happy.
But Failover ....?
I kill one of the managed application server in cluster at any particular
test fail point.
I expect the exception to be taken care automatically by error/failover
handler in the home/remote stub
But the client program fails and terminates.
1. What is wrong with the code ?
2. Does the automatic failover with the indempotent methods also has to be
taken care by coding the similar while loop for stateless ejb ?
Your help will be appreciated ASAP.
Let me know if you need any thing more from my system. But I am sure this
will be very easy as it is from the sample code.........
Thanks
Sorry I meant to send this to the ejb newsgroup.
dan
dan benanav wrote:
> Do any vendors provide for clustering with automatic failover of entity
> beans? I know that WLS does not. How about Gemstone? If not is there
> a reason why it is not possible?
>
> It seems to me that EJB servers should be capable of automatic failover
> of entity beans.
>
> dan
-
Noob Question: Problem with Persistence in First Entity Bean
Hey folks,
I have started with EJB3 just recently. After reading several books on the topic I finally started programming myself. I wanted to develop a little application for getting a feeling of the technology. So what I did is to create a AppClient, which calls a Stateless Session Bean. This Stateless Bean then adds an Entity to the Database. For doing this I use Netbeans 6.5 and the integrated glassfish. The problem I am facing is, that the mapping somehow doesnt work, but I have no clue why it doesn't work. I just get an EJBException.
I would be very thankfull if you guys could help me out of this. And don't forget this is my first ejb project - i might need a very detailed answer ... I know - noobs can be a real ....
So here is the code of the application. I have a few methods to do some extra work there, you can ignore them, there are of no use at the moment. All that is really implemented is testConnection() and testAddCompany(). The testconnection() Methode works pretty fine, but when it comes to the testAddCompany I get into problems.
Edit:As I found out just now, there is the possibility of Netbeans to add a Facade pattern to an Entity bean. If I use this, everythings fine and it works out to be perfect, however I am still curious, why the approach without the given classes by netbeans it doesn't work.
public class Main {
private EntryRemote entryPoint = null;
public static void main(String[] args) throws NamingException {
Main main = new Main();
main.runApplication();
private void runApplication()throws NamingException{
this.getContext();
this.testConnection();
this.testAddCompany();
this.testAddShipmentAddress(1);
this.testAddBillingAddress(1);
this.testAddEmployee(1);
this.addBankAccount(1);
private void getContext() throws NamingException{
InitialContext ctx = new InitialContext();
this.entryPoint = (EntryRemote) ctx.lookup("Entry#ejb.EntryRemote");
private void testConnection()
System.err.println("Can Bean Entry be reached: " + entryPoint.isAlive());
private void testAddCompany(){
Company company = new Company();
company.setName("JavaFreaks");
entryPoint.addCompany(company);
System.err.println("JavaFreaks has been placed in the db");
}Here is the Stateless Session Bean. I added the PersistenceContext, and its also mapped in the persistence.xml file, however here the trouble starts.
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
@Stateless(mappedName="Entry")
public class EntryBean implements EntryRemote {
@PersistenceContext(unitName="PersistenceUnit") private EntityManager manager;
public boolean isAlive() {
return true;
public boolean addCompany(Company company) {
manager.persist(company);
return true;
public boolean addShipmentAddress(long companyId) {
return false;
public boolean addBillingAddress(long companyId) {
return false;
public boolean addEmployee(long companyId) {
return false;
public boolean addBankAccount(long companyId) {
return false;
}That you guys and gals will have a complete overview of whats really going on, here is the Entity as well.
package ejb;
import java.io.Serializable;
import javax.persistence.*;
@Entity
@Table(name="COMPANY")
public class Company implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Column(name="COMPANY_NAME")
private String name;
public Long getId() {
return id;
public void setId(Long id) {
this.id = id;
public String getName() {
return name;
public void setName(String name) {
this.name = name;
System.err.println("SUCCESS: CompanyName SET");
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Company)) {
return false;
Company other = (Company) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
return true;
@Override
public String toString() {
return "ejb.Company[id=" + id + "]";
}And the persistence.xml file
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="PersistenceUnit" transaction-type="JTA">
<provider>oracle.toplink.essentials.PersistenceProvider</provider>
<jta-data-source>jdbc/sample</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="toplink.ddl-generation" value="create-tables"/>
</properties>
</persistence-unit>
</persistence>And this is the error message
08.06.2009 10:30:46 com.sun.enterprise.appclient.MainWithModuleSupport <init>
WARNUNG: ACC003: Ausnahmefehler bei Anwendung.
javax.ejb.EJBException: nested exception is: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.; nested exception is:
javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.; nested exception is:
javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:243)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:205)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
at ejb.__EntryRemote_Remote_DynamicStub.addCompany(ejb/__EntryRemote_Remote_DynamicStub.java)I spend half the night figuring out whats wrong, however I couldnt find any solution.
If you have any idea pls let me know
Best regards and happy coding
Taggert
Edited by: Taggert_77 on Jun 8, 2009 2:27 PMWell I don't understand this. If Netbeans created a Stateless Session Bean as a facade then it works -and it is implemented as a CMP, not as a BMP as you suggested.
I defenitely will try you suggestion, just for curiosity and to learn the technology, however I dont have see why BMP will work and CMP won't.
I also don't see why a stateless bean can not be a CMP. As far as I read it should not matter. Also on the link you sent me, I can't see anything related to that.
Maybe you can help me answering these questions.
I hope the above lines don't sound harsh. I really appreciate your input.
Best regards
Taggert -
hi all,
m very new to ejb...m crerating container managed entity bean in wsed..The steps I have followed r as follows,
i) created 2 tables in database,one is PARENT with fields ID(Primary Key) and NAME and another is CHILD with fields ID1(Foreign Key) and NAME.
ii)created 2 entity beans... 1st is parent with fields id(key field) and name(promote getter & setter methods to local interface)...2nd is child
(choosed parent as bean super type) with fields id1 (promote getter & setter methods to local interface) and name (promote getter & setter methods to local interface)...
iii)Generated EJB to RDB mapping(choosed crreate new backend folder->meet in the middle->use existing connection->choosed the tables parent & child in the database->match by name->finish)
now m getting an error in Map.mapxmi--->"The table PARENT does not have a discriminator column"...and a warning--->"A primary key does not exist for table: CHILD in file: platform:/resource/NewFK/ejbModule/META-INF/backends/DB2UDBNT_V8_1/Map.mapxmi. Map.mapxmi NewFK/ejbModule/META-INF/backends/DB2UDBNT_V8_1 L/NewFK/ejbModule/META-INF/backends/DB2UDBNT_V8_1/Map.mapxmi"Hi Sandra,
Many thanks for your response and providing time of yours.
Now, I have done exactly the same thing, but still it is the same.
I have created two new tables as below:
ZAAVREF (Check table)
MANDT (PK)
COUNTRY (PK) Domain:ZAACOUNT (CHAR 10)
ZAAV1 (Foreign key table)
MANDT (PK)
COUNTRY (PK) Domain:ZAACOUNT (CHAR 10)
Then I have created FK on country of foreign key table ZAAV1 and then SE16 (for table ZAAVREF)->Create Entries-> Entered values for Country only->Save....Records entered with valid Country values.
After that SE16 (for table ZAAV1)->Create Entries-->Entered an Invalid country->Save->Still the record entered to the Database successfully....
Could you please let me know where I am going wrong.
I am using SAP R/3 4.7 and creating tables using Tools->ABAP Workbench->Development->ABAP dictionary -
Problem with ejb 3.0 entity beans with manyToMany relationship
Hello everyone!
I am using struts 1.2.9 and java ee 5 sdk update 2 for my enterprise application. Besides others i have these entity beans Targetgroup.java and City.java, (i would upload file but i do not know how:)
with manytomany relationship with join table.
when user updates Targetgroup, by clicking on web page with checkboxes and textfields, struts dispatch action calls following method stateless bean:
public void update(String firmId, String targetgroupId, String newGender, String newMinYearsOld, String newMaxYearsOld, String[] newCities) {
TargetgroupPK pkForUpdate = new TargetgroupPK(targetgroupId, firmId);
Targetgroup targetgroupForUpdate = find(pkForUpdate);
targetgroupForUpdate.setGender(newGender);
targetgroupForUpdate.setMinyearold(Integer.parseIn t(newMinYearsOld));
targetgroupForUpdate.setMaxyearold(Integer.parseIn t(newMaxYearsOld));
//pronalazenje gradva za koje je vezana ciljna grupa
Collection<City> newCitiesCollection = new ArrayList<City>();
for(int i = 0; i < newCities.length; i++){
String tmp_city_name = newCities;
City city_obj = cityFacade.find(tmp_city_name);
newCitiesCollection.add(city_obj);
targetgroupForUpdate.setCityidCollection(newCities Collection);
parameter newCities represents names of cities which user checked on his update page. When the page is showen to him some cities are allready check because they were connected with Targetgruoup when it was created (targetgroup).
this code throws following exception:
[#|2007-07-26T12:13:36.993+0200|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_Threa dID=16;_ThreadName=httpWorkerThread-8080-0;_RequestID=f79d9c50-86b0-4b6c-96ab-97956dfb39c1;|StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.
javax.transaction.RollbackException: Transaction marked for rollback.
at
.com.sun.enterprise.web.connector.grizzly.WorkerTh read.run(WorkerThread.java:75)
javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.
at com.sun.ejb.containers.BaseContainer.completeNewTx (BaseContainer.java:3659)
at com.sun.ejb.containers.BaseContainer.postInvokeTx( BaseContainer.java:3431)
at com.sun.ejb.containers.BaseContainer.postInvoke(Ba seContainer.java:1247)
at com.sun.ejb.containers.EJBLocalObjectInvocationHan dler.invoke(EJBLocalObjectInvocationHandler.java:1 92)
at com.sun.ejb.containers.EJBLocalObjectInvocationHan dlerDelegate.invoke(EJBLocalObjectInvocationHandle rDelegate.java:71)
at $Proxy149.update(Unknown Source)
at audiotel.sms.actions.backoffice.TargetgroupDispatc hAction.updateOrDelete(TargetgroupDispatchAction.j ava:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.struts.actions.DispatchAction.dispatchM ethod(DispatchAction.java:270)
at org.apache.struts.actions.DispatchAction.execute(D ispatchAction.java:187)
at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:727)
com.sun.enterprise.web.connector.grizzly.WorkerThr ead.run(WorkerThread.java:75)
|#]
exceprion is throwen ONLY when in parameter newCities are city names allready connected to Targetgroup. when NewCities contains names of
City objects which are not connected to Targetgroup it works fine, but it's of no use for me, because user must be able to add or remove certian cities from relaionship with Targetgroup. I think it's because there are rows in join table that contain primary keys of city and targetgroup which are connected so perisistence manager cann't write them again.
i thought it was going to figure it out by itself, and only update those rows.
Does anyone know what is the problem and solution?
Thanks! (forgive my spelling errors :)solved the problem!
I moved code from sesion bean to struts action as follows:
CityFacadeLocal cityFacade = lookupCityFacade();
//prikupljanje novih podataka o ciljnoj grupi
String newGender = ctf.getGender();
String newMaxYears = ctf.getMaxyears();
String newMinYears = ctf.getMinyears();
String[] newSelectedCities = ctf.getSelectedCities();
//niz imena gradova se prevodi u kolekcju objekata City
Collection<City> newCitiesObjCollection = new Vector<City>();
for(int i = 0; i < newSelectedCities.length; i++){
String tmpCityName = newSelectedCities;
City tmpCityObj = cityFacade.find(tmpCityName);
newCitiesObjCollection.add(tmpCityObj);
//setovanje novih podataka
targetgroupForUD.setGender(newGender);
targetgroupForUD.setMinyearold(Integer.parseInt(newMinYears));
targetgroupForUD.setMaxyearold(Integer.parseInt(newMaxYears));
targetgroupForUD.setCityidCollection(newCitiesObjCollection);
//pozivanje update metdoe u session beany
targetgroupFacade.edit(targetgroupForUD);
//korisnik se vraca na stranu sa svim postojecim ciljnim grupama
forward = mapping.findForward("backend.targetgroups");
and now it works fine. I guess probelm was same transaction scope for Targetgroup and City entities. Now when they are separated it works.
Thanks! -
Help with exception calling cmp entity bean from session bean
Hi,
I know someone else posted a very similar problem recently but I think the root of my problem may be different.
This is the exception that I receive:
javax.transaction.TransactionRolledbackException: CORBA TRANSACTION_ROLLEDBACK 9998 Maybe; nested exception is:
org.omg.CORBA.TRANSACTION_ROLLEDBACK: vmcid: 0x2000 minor code: 1806 completed: Maybe
at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:114)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
at itsthes.security._SecurityManager_Stub.findUserRoles(Unknown Source)
at itsthes.security._SecurityManager_Stub.findUserRoles(Unknown Source)
at itsthes.security.servlets.SecurityUserListView.processRequest(SecurityUserListView.java:80)
at itsthes.security.servlets.SecurityUserListView.doGet(SecurityUserListView.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
Caused by: org.omg.CORBA.TRANSACTION_ROLLEDBACK: vmcid: 0x2000 minor code: 1806 completed: Maybe
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:306)
at java.lang.Class.newInstance(Class.java:259)
at com.sun.corba.ee.internal.iiop.messages.ReplyMessage_1_2.getSystemException(ReplyMessage_1_2.java:94)
at com.sun.corba.ee.internal.iiop.LocalClientResponseImpl.getSystemException(LocalClientResponseImpl.java:120)
at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOAClientSC.java:133)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
at itsthes.security._SecurityManager_Stub.findUserRoles(Unknown Source)
... 17 more
This is my primary key implementation:
public final class SecurityUserKey implements java.io.Serializable {
public java.lang.Integer userId;
public java.lang.Integer roleId;
public java.lang.String emailAddress;
* Creates an empty key for Entity Bean: SecurityUser
public SecurityUserKey() {
* @see java.lang.Object#equals(java.lang.Object)
public boolean equals(java.lang.Object otherOb) {
if (this == otherOb) {
return true;
if (!(otherOb instanceof itsthes.security.entitybeans.SecurityUserKey)) {
return false;
itsthes.security.entitybeans.SecurityUserKey other = (itsthes.security.entitybeans.SecurityUserKey) otherOb;
return (
(userId==null?other.userId==null:userId.equals(other.userId))
(roleId==null?other.roleId==null:roleId.equals(other.roleId))
(emailAddress==null?other.emailAddress==null:emailAddress.equals(other.emailAddress))
* @see java.lang.Object#hashCode()
public int hashCode() {
return (
(userId==null?0:userId.hashCode())
^
(roleId==null?0:roleId.hashCode())
^
(emailAddress==null?0:emailAddress.hashCode())
My entity method invocation is this:
public Collection findUserRoles() {
Vector userCollection=new Vector();
try {
Context jndiContext = new InitialContext();
LocalSecurityUserHome home = (LocalSecurityUserHome) jndiContext.lookup(this.securityUserBean);
Iterator i = home.findAll().iterator();
while ( i.hasNext() ) {
LocalSecurityUser securityUser = (LocalSecurityUser)i.next();
SecurityUser sessionBean=mapLocalSecurityUser(securityUser);
userCollection.add(sessionBean);
} catch (javax.naming.NamingException e) {
System.err.println(e);
} catch (javax.ejb.FinderException e) {
System.err.println(e);
return userCollection;
If anyone could point me in the right direction that would be great.
thanks,
WilliamHi,
The Transaction Rollback exception may be due to the SystemException thrown in your findUserRoles() code which force the container to rollback the transaction. catch the generic exception in your findUserRoles() code and veriy what went wrong.
i hope this helps.
-ram -
Hi,
Is it possible to configure UC560 and UC540s kept in different locations as Publisher and Subscribers and there by avail the centralised deployment advandages?
I have one client with one UC560 at Head office and two UC540s at two different branch offices. I wnat to configure the extension mobility feature for all the users to access their profile at any site. They got VPN over normal internet connection not a MPLS connection. Can anybody help me on this?Sorry I meant to send this to the ejb newsgroup.
dan
dan benanav wrote:
> Do any vendors provide for clustering with automatic failover of entity
> beans? I know that WLS does not. How about Gemstone? If not is there
> a reason why it is not possible?
>
> It seems to me that EJB servers should be capable of automatic failover
> of entity beans.
>
> dan
-
Clustering with HttpClusterServlet
I have created a domain on my machine in which I have configured an admin server and two more instances that are part of a cluster. When I try to connect to any of the cluster instances after I deploy an application on them it runs fine. However when I try to access the HttpClusterServlet deployed on the admin server it says Error 404--Not Found
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.4.5 404 Not Found
Sorry I meant to send this to the ejb newsgroup.
dan
dan benanav wrote:
> Do any vendors provide for clustering with automatic failover of entity
> beans? I know that WLS does not. How about Gemstone? If not is there
> a reason why it is not possible?
>
> It seems to me that EJB servers should be capable of automatic failover
> of entity beans.
>
> dan
-
Hi........
We are having an application running over clusters, for loadbalancing and failovers,
Now, the requirement is, whenever any error occus (or any unusual condition), we need to track
which server (cluster) had processed that request, I.E we need to track which server caused the problem,
(just assume, in response i need to print which server has processed the request).
we are having different clusters like, www1.mysite.com, www2.mysite.com www3.xxx www4. etc....
I have tried request.getServerName() it returns same name mysite.com on all the clusters,
I think request.getLocalName() should do the work.
I was not able to get it done using context.
If any one has any idea...
We are using Apache Geronimo application server.
[Java Servlet tutorials|http://www.jsptube.com]Sorry I meant to send this to the ejb newsgroup.
dan
dan benanav wrote:
> Do any vendors provide for clustering with automatic failover of entity
> beans? I know that WLS does not. How about Gemstone? If not is there
> a reason why it is not possible?
>
> It seems to me that EJB servers should be capable of automatic failover
> of entity beans.
>
> dan
-
Clustering with bandwith logic
Hi everybody,
I have requirement to cluster data, but I cannot figure out if it is possible with the ADP.
Maybe one of you folks have a suggestion.
Assume the following data set:
Mth Variance Cluster result required
Jan 0 1
Feb 1 1
Mar -1 1
Apr 2 1
May 10 2
Jun 11 2
Jul 12 2
Aug 20 3
Sep 21 3
Oct -100 4
Nov -101 4
Dec 999 5
The clustering logic is simply that any variance within a band of +/-3 belong to the same cluster.
So with Jan being the base month (variance is by definition 0) months Jan-April constitutes
cluster 1.
Cluster 2 includes the months May-July, etc.
There can be a maximum of 12 clusters (in the extreme case where no variances are within the
+/-3 band of each other). The size of the variance can be any number.
Can this be solved with standard functionalities or do I have to program a FM for this?
Greetings,
MartinSorry I meant to send this to the ejb newsgroup.
dan
dan benanav wrote:
> Do any vendors provide for clustering with automatic failover of entity
> beans? I know that WLS does not. How about Gemstone? If not is there
> a reason why it is not possible?
>
> It seems to me that EJB servers should be capable of automatic failover
> of entity beans.
>
> dan
-
HACMP Clustering Script for SAP ECC 6.0 (SR1) - Automatic Failover
Hello,
I have installed the SAP ECC 6.0 (SR1) under AIX 5.3 / DB2 V8 FP12 with HACMP Clustering environment. Manual Failover is working fine. Central System has been installed in share drive with Virtual IP and Virtual name inNode A. Dialog Instance is loaded locally in Node B. I want to get HACMP Clustering script(automatic failover script) for Automation. Please help me if you have. It is single package clustering. If Node A fails, Node B will take care ( Central System and Dialog instance will run in Node B)
Thanks
Gautam Poddarthis post is duplicated at Upgrade to ERP 2005/ECC 6.0 from R/3 4.72/Basis 640 on Z/OS 1.4 DB2 8.1
-
HACMP Clustering Script for SAP ECC 6.0 (SR1) - Automatic Failover-Oracle10
Hello,
I have installed the SAP ECC 6.0 (SR1) under AIX 5.3 / Oracle 10g with HACMP Clustering environment. Manual Failover is working fine. ASCS and Database instances are loaded in share drive with Virtual IP and Virtual name. Central Instance and Dialog Instance are loaded locally in Node A and Node B. I want to get HACMP Clustering script(automatic failover script) for Automation. Please help me if you have.
Thanks
Gautam PoddarHere are HA stop & start scripts that you should be able adapt for your particular circumstances. Based on earlier versions of SAP / Oracle but assume should be a reasonable guide
Script to start SAP is start_sap_prd
#!/bin/ksh
Script: /usr/local/bin/cluster/start_sap_prd
Comments: HACMP Application START script for PRD
Show me obvious information in hacmp.out
banner "Starting"
banner "PRD SAP"
Set the oracle and sap owner.
ORASID="PRD"
SAPADM="prdadm"
ORAUSR="oraprd"
VIRTUALHOST="vhost"
DEVHOST="vhostdev"
Get the volume groups for this resource group
RG=$( /usr/es/sbin/cluster/utilities/cllsgrp | grep -i $ )
VG_LIST=$( /usr/es/sbin/cluster/utilities/cllsres -g $ | \
grep "VOLUME_GROUP=" | \
awk -F\" '{ print $2 }' )
Check the transport directory is mounted.
if mount | grep -w "/usr/sap/trans"
then
print "Transport directory is already mounted."
else
cd /tmp
print "Attempting a background mount of the transport directory."
nohup mount -o intr,bg,soft :/usr/sap/trans1 /usr/sap/trans &
fi
#Start SAP and Oracle
#Start listener
su - $ -c /rprd/oracle/PRD/920_64/bin/lsnrctl start
rc=$?
if [ $? != 0 ]
then
echo "ERROR: Listener failed to start\n"
fi
#Start Database
su - $ -c "/rprd/oracle/PRD/bin/start_database_PRD.sh"
sleep 20
Standard sapstart script
su - $ -c startsap $
Script: /usr/local/bin/cluster/stop_sap_prd
Dated: 01/11/06
Application: Oracle/SAP
Comments: HACMP Application STOP script for SAP / Oracle PRD
Show me obvious information in hacmp.out
Set the oracle and sap owner.
rc=$?
if [ $? != 0 ]
then
echo "ERROR: Failed to start SAP\n"
fi
exit 0
Script to stop SAP is stop_sap_prd
#!/bin/ksh
set -x
banner "stopping"
banner "PRD SAP"
ORASID="PRD"
SAPADM="prdadm"
ORAUSR="oraprd"
VIRTUALHOST="vhost"
#Stop SAP/Oracle
su - $ -c stopsap $
rc=$?
if [ $? != 0 ]
then
echo "ERROR: Failed to stop SAP and Oracle\n"
break
fi
Stop SAP collector and Oracle listener.
su - $ -c /usr/sap/PRD/SYS/exe/run/saposcol -k
rc=$?
if [ $? != 0 ]
then
echo "ERROR: Failed to stop SAPOSCOL \n"
fi
su - $ -c /rprd/oracle/PRD/920_64/bin/lsnrctl stop
rc=$?
if [ $? != 0 ]
then
echo "ERROR: Listener failed to stop\n"
fi
if mount | grep -w "/usr/sap/trans"
then
print "Transport directory is mounted."
/usr/es/sbin/cluster/events/utils/cl_nfskill -k -u /usr/sap/trans
sleep 1
/usr/es/sbin/cluster/events/utils/cl_nfskill -k -u /usr/sap/trans
sleep 1
umount -f /usr/sap/trans &
else
print "Transport directory is not mounted."
fi
exit 0 -
Multiple instances of the same entity bean?
I am designing a J2EE application that is made up of a number of separate components that each have a well-defined responsibility. Each component is made up of one or more J2EE components (web clients and EJBs). I want to design the application such that it is easy in the future to deploy each component (or a group of components) on different servers. In order to do this I need to make sure that the interfaces between each component are exposed as remote interfaces (but I will use local interfaces inside each component). However, there are a number of entity beans that need to be accessed by more than one component. I am wondering how best to expose these entity beans. I believe there are a number of options:
1. Expose remote interfaces on each of the shared entity beans. The disadvantage of this approach is that it is inefficient and that I will not be able to take advantage of container managed relationships. (I am intending to use container managed persistence.)
2. Create a facade object (stateful session bean) for each of the entity beans which exposes a remote interface and in turn accesses the shared entity beans locally. The disadvantage of this approach is that I have to create some extra EJBs and that I cannot directly make use of container managed relationships etc from the client component.
3. I don't know if this is an option but I am wondering whether I can deploy a copy of each shared entity bean with each application component. The advantage of this approach is that the component would access the entity locally and could make use of container managed relationships. However, I don't know what the issues are with having more than one instance (per primary-key) of an entity in the same application. I don't know whether this would cause errors of whether they would get out of sync (because different instances with the same primary key would be updated by different clients). Initially each component would be deployed in the same server but later they would be deployed in different servers. In both cases with this option each component (JAR) would have copies of the shared entity bean classes.
Any suggestions as to the best approach and whether the last option is feasible would be much appreciated.
Thanks.I think 2 beats 1. The main reason being to minimise the number of network calls. You're basically asking, are fascades a good idea? and the answer is yes.
You can obviously do 3 in different app servers. However you'll need to configure your app servers so they can handle the fact that they're not the only ones updating the database. This is to handle concurrency as you mentioned. How you do this will depend on your app server and will affect performance, but shouldn't be a problem.
I think you should definately decide up front what's going in different app servers, I dunno if 3 would work in the same app server.
Why do you would want to use multiple app servers?
Why not have everything in the same app?
Is is just the 1 database?
You can use clustering for scalability. -
SQL 2005 mirroring : Abrupt Automatic failover
hi All,
We have a SQL 2005 SP4 mirroring setup of 15 DBs with Principal(P), Mirror(M) & Witness (W).
We have now seen abrupt DB failovers for some of the databases (yest it was 4 out of 15) from P to M.
Errors were seen on Witness server as follows for all Dbs that failed over:
Date 07/01/2015 11:07:48 PM
Log SQL Server (Current - 08/01/2015 12:00:00 AM)
Source spid19s
Message
The mirroring connection to "TCP://<server.domain.com>:5022" has timed out for database "<DBName>" after 10 seconds without a response. Check the service and network connections.
Actions taken:
1. Network and Firewall team reverted that no error detected and no network traffic between the witness server and db server during the db auto failover period.
2. On the system side, we have verified that no hardware error found on either VM or SAN storage, and no Symantec SQL backup jobs running nor anti virus scanning during the db auto failover period too.
3. We did see some high amount of IO activity on P server around failover time. Some IO errors similar to below were seen, however point to note is these errors were not only for the DBs that failed over, but for others including TEMPDB:
Date 07/01/2015 11:07:38 PM
Log SQL Server (Current - 08/01/2015 4:06:00 AM)
Source spid2s
Message
SQL Server has encountered 1 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [R:\SQLDATA\MSSQL.1\MSSQL\Data\<DBName>.mdf] in database [DBName] (5). The OS file handle is 0x000000000000095C. The offset of the
latest long I/O is: 0x0000054ff22000
Questions:
1. I assumed that the Witness keeps polling P & M on DB mirroring endpoints (in our case 5022) to check that the DBs are online, but Network team says there is no activity on that port, is my understanding correct?
2. Is there any other reason for DB failover ?
Link referred:
http://dba.stackexchange.com/questions/22402/what-can-cause-a-mirroring-session-to-timeout-then-failover-sql-server-2005
http://msdn.microsoft.com/en-us/library/ms179344(v=sql.90).aspx
Any help is highly appreciated!!!
Regards,
MandarThis is common with Mirroring server it is not as resilient to changes as log shipping. Are you aware about
below fact although not directly related to your question
If you plan to use high-safety mode with automatic failover, the normal load on each failover partner should be less than 50 percent of the CPU. If your work load overloads the CPU, a failover partner might be unable to ping the other server instances in
the mirroring session. This causes a unnecessary failover. If you cannot keep the CPU usage under 50 percent, we recommend that you use either high-safety mode without automatic failover or high-performance mode.
Now to your problem
The mirroring connection to "TCP://<server.domain.com>:5022" has timed out for database "<DBName>" after 10 seconds without a response. Check the service and network connections.
I would say there was network dip for more than 10 seconds and since default failover time is 10 seconds and for few databases witness thought principal cannot be reached it initiated failover.
Network team is incorrect to say there was no dip (its common with NOC team not to take responsibility)
This Support Article is worth reading specially the network part
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
My Technet Wiki Article
MVP -
Can I deploy the entity bean in different jar files?
I have an application EAR, which contains several JARs. I have an entity bean A that has relationships with 2 other different entity beans B and C in the same DB. Now, I have to deploy this entity A together with B in AB.jar, and A with C in AC.jar. Both AB.jar and AC.jar are modules of the same application EAR file. They all use the same data sources to the same database, and named by different <ejb-name>.
I have no problem with deploying the app to WebLogic 8.1. But the JSP page accessing entity A got errors. Sometime, it got error complaining that the container-generated ejbFindAccount mehtod is abstract.
My questions are,
Can an entity bean be defined twice in 2 different jars?
When container load AB.jar and AC.jar, does it generate the finder methods twice?
I guess there are some name conflicts going on here. What should I do to avoid it?
Any comments are very much appreciated.Thanks for your answer, but how can I use it in connection with relationships?
<!-- ********************************************************************** -->
<!-- Relationship: View to FrameworkUser -->
<!-- ********************************************************************** -->
<ejb-relation id="View-FrameworkUser">
<description></description>
<ejb-relation-name>View-FrameworkUser</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>Views-have-FrameworkUser</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>View</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>frameworkUser</cmr-field-name><!-#- getter/setter -#->
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<!-#- *************** -#->
<ejb-relationship-role>
<ejb-relationship-role-name>FrameworkUser-has-Views</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<!-#- *******REFERENCE******** -#->
<ejb-name>ejb_foo_jar2_ejb.jar#FrameworkUser</ejb-name>
<!-#- *******REFERENCE******** -#->
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
...this obviously doesn't work...
Do I have to write a new <entity> where I define the referenced entity?
Maybe you are looking for
-
Apple Ipod ....a mistak
I wanted to make a good present for my dad so 3 weeks ago i bought a new ipod with color display ! after week apple release a new one the famous ipod with video ? If you go to apple forum you can see how many people are dissapointed from a brand that
-
Safari 8.0.2 lagging (or crashing) because of WebGL
Specs: MacBook Pro (Retina, 13-inch, Mid 2014) 2.6 GHz Intel Core i5 8 GB 1600 MHz DDR3 Intel Iris 1536 MB I'm having some trouble with what appears to be WebGL in Safari, it seems to crash running this page (however runs fine in Chrome and Firefox),
-
Hi all, I am on the connection page of discoverer plus having already authenticated through SSO. However the logout icon is visable but not underlined or clickable. Any ideas why this is so and how I can enable it? Thanks, Paul
-
N80ie Not Receiving IP Address
I have a N80ie with the Wireless Wizzard installed. Works like a charm with most WiFi networks except for my home network. At home I have ADSL with a D-Link AP. I have NO PROBLEM connecting to the WiFi AP; however, neither the AP nor the ADSL router
-
Kann mir jemand helfen?