Sami Casab

Greenhorn
+ Follow
since Nov 28, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sami Casab

Hi EveryBody:
I want to make some tests with j2me on a compa ipaq and hp Jornada. I found information about jeode, and i want to ask you:
1.-To run j2me applicaitions exist other solution better and/or free?
2.-Exists a jeode trial? I cannot find the link....
Thanks in adnvance.
21 years ago
Diana:
Thanksfor the help, but i this methods are part of the transaction, is a very strange situation.
Chears.
I have some problems with this and i want to ask you if i have two simultaneos users updating a cmp field the container should prevent this?
How many instances of the entity bean should the container create for each record?
im Wonderig if i will control this with a Bean managed transactions, but im not sure, could you give me an advise?
Thanks in advance.
I used websphere and i need to create a class thats wrap my primmary key because if dont do this simply it doesnt work. Im now using Borland Enterprise Server 5.2 and it dont force me to create a wrap class, i can directly map to a field.
In my point of view in some cases this wrap class is overwork.
Sami
I used some components from Borland called resolver and provideders. This components gave me the flexibility and power of EJB with some behavor of a query or table. This componente can be attached directly to a dbswing components from borland. This is a Borland solution and you need JBuilder, but if you dont have this components you can write your own code and it is not dificutl because when the the ejb is instansiated from the client the ejb methods calls are very similar (or identical) to normal bean methods calls.
I hope this help you.
Your web modules frecuently are packed in a war file so to deploy it is diferent from one vendor to other but i suggest you that first generates the war.
To deploy the ejb geneally they are packed in a jar file. Also you can generate a EAR file with the two files jar and the war files.
Your servlets, jsp, ejb will be running on the server. Your client applications like applets will run on the client side. This file will be downloaded to the client machine and ejecuted on client jvm.
I hoope this help you.
As Java ide i use JBuilder (as far as i know the best ide for java),For design and modeling i use together and for testing i use optimize it, all from Borland (www.borland.com).
i hoope this help you.
I used some components from Borland called resolver and provideders. This components gave me the flexibility and power of EJB with some behavor of a query or table. This componente can be attached directly to a dbswing components from borland. This is a Borland solution and you need JBuilder, but if you dont have this components you can write your own code and it is not dificutl because when the the ejb is instansiated from the client the ejb methods calls are very similar (or identical) to normal bean methods calls.
I hope this help you.
Java is divided (as far as i know) in tree, micro edition, standard edition, and enterprise edition. J2ee includes all the tecnology to build enterprise application frecuently applications that runs on servers.
I hoope this help you.
EJB gives you an easy way to build tree tir applications with security, transactions, fault tolerance, etc.
In a client server application you have two tiers and frecuently the second tir (database) has stored procedures and triggers to resolve the application logic and buisines rules. With EJB you can write the logic in a midleware not in the database.
I expermimented a web app in two tires and tree tires. I discover that the application have a better performance in tree tired architecture, maybe because there are less database connections.
I hope this help you.
Sami.
Where is your main method?
Are you creating a new instance?
Hi EveryBody:
Im having problems with concurrent cmp entity beans y BES 5.2.
I have a SesionBean with a method called getNextPk(). This method finds an
entity bean using findByPrimaryKey method and set a new value with a one of
the EntityBean set Methods. In the table asociated with the entity bean i
have only one record with two fields, prmary key and nextValue, each field
with start value of 1. If i call the getNextPk method from one client
everithing works fine, but if i call the method from 5 difernt concurrent
clients the app server creates 5 diferent instances of my entity bean? this
is normal? i never call a create method and i have only one record on my
table.... .I dont know if this is normal, but the problem is when i set a
new value in the entity bean because the other 4 instances doesnt get the
new value never. Is like the container and/or the entitybean doesnt know
than the data was changed for other entity bean instance.
This a BES cmp bug? This is normal? if this is normal how can i tell a cmp
bean than it need to store the data in the database an refresh the other
bean instances?
I turned off the Entitybean cache options.

Any Help will be appreciated, this is the main code of my application:

//*************This is my SesionBean:

import javax.ejb.*;
import javax.rmi.PortableRemoteObject;
import java.rmi.*;
public class GeneradorBean implements SessionBean {
SessionContext sessionContext;
private GenPkHome genPkHome;
private PruebaRemoteHome pruebaRemoteHome = null;

public void ejbCreate() throws CreateException {
}
public void ejbRemove() {
}
public void ejbActivate() {
}
public void ejbPassivate() {
}
public void setSessionContext(SessionContext sessionContext) {
try {
javax.naming.Context context = new javax.naming.InitialContext();
Object ref = context.lookup("PruebaRemote");
pruebaRemoteHome = (PruebaRemoteHome) PortableRemoteObject.narrow(ref,
PruebaRemoteHome.class);
} catch(javax.naming.NamingException e) {
throw new javax.ejb.EJBException(e);
}
}
public int getNuevoNextPk() {
PruebaRemote pruebaRemote = null;
int regreso=0;
try {
pruebaRemote = pruebaRemoteHome.findByPrimaryKey(new Integer(1));
for (int ix=0; ix<100;ix++){
Integer valorActual = pruebaRemote.getValor();
pruebaRemote.setValor(new Integer( valorActual.intValue()+1) );}
regreso=pruebaRemote.getValor().intValue();
} catch(Exception ex) {
ex.printStackTrace();
}

return regreso;
}
}
//**** THIS IS MY ENTITYBEAN
package servidor;
import javax.ejb.*;
abstract public class PruebaBean implements EntityBean {
EntityContext entityContext;
public java.lang.Integer ejbCreate(java.lang.Integer llave) throws
CreateException {
setLlave(llave);
return null;
}
public void ejbPostCreate(java.lang.Integer llave) throws CreateException
{
/**@todo Complete this method*/
}
public void ejbRemove() throws RemoveException {
/**@todo Complete this method*/
}
public abstract void setLlave(java.lang.Integer llave);
public abstract void setValor(java.lang.Integer valor);
public abstract java.lang.Integer getLlave();
public abstract java.lang.Integer getValor();
public void ejbLoad() {
/**@todo Complete this method*/
}
public void ejbStore() {
/**@todo Complete this method*/
}
public void ejbActivate() {
/**@todo Complete this method*/
}
public void ejbPassivate() {
/**@todo Complete this method*/
}
public void unsetEntityContext() {
this.entityContext = null;
}
public void setEntityContext(EntityContext entityContext) {
this.entityContext = entityContext;
}
}

//*********************Finally this is my testClient, i control the number
of threads with the MAX variable.
package test;
import cliente.DmCliente;
import servidor.*;
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.rmi.PortableRemoteObject;
import java.rmi.*;
import javax.ejb.*;

public class GeneradorTestClient2 extends Thread {
String nombre;
Generador generador;
GeneradorHome generadorHome;
public GeneradorTestClient2() {
try {
Context context = new InitialContext();
Object object = context.lookup("Generador");
generadorHome = (GeneradorHome) PortableRemoteObject.narrow(object,
GeneradorHome.class);
generador = generadorHome.create();
} catch(Exception e) {
System.out.println(e.getMessage());
}
}
public void serNombre(String nombre){
this.nombre = nombre;
}
public void run() {
for(int i = 0; i < 4; i++) {
try {
System.out.println(nombre + " " + generador.getNuevoNextPk());
} catch(RemoteException ex) {
ex.printStackTrace();
}
}
}
public static void main(String[] args) {
int MAX = 5; //********Number of max Threads
for(int i = 1; i <= MAX; i++) {
GeneradorTestClient2 x = new GeneradorTestClient2();
x.serNombre("N"+i);
x.start();
}
}
}

Hi EveryBody:
I want to modify struts tags inside dreamweaver mx, if found this for ultradev http://jakarta.apache.org/taglibs/doc/ultradev4-doc/intro.html and i want to know if exist an equivalent for dreamweaver mx (the new version of macromedia ultradev)
Thanks in advance.
21 years ago
I Have now the mssql jdbc driver and i can execute sql statments against the transactional server, but how can i execute MDX instruccions against the Olap Server.
Thanks in advance.
Hi EveryBody:
Im searching for a solution to create a servlet or jsp using an Olap Conexion to MSSQL Olap Server. I will really appreciate any advisment or tip about where to download jolap driver or something similar.
Thanks in advance.