Problem migrating from jboss 4.0.5 to 5.1.0GA
juanes1183 Jul 11, 2011 11:53 AMHi,
I have a problem. I'm migrating from jboss 4.0.5 to 5.1.0GA, and migrating from EJB 2.1 to EJB 3. When I pass an object of type Stagestracking to an EJB, and modify an attribute, the attribute is modified in the ejb, but when using the object to the online, that has not been modified.
Note: jboss 4 at track to reference the object after running the method addStageTrack, this appears modified, while in the JBoss 5 does not appear modified in order
for example:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
public class OnlineBDAccounting {
protected AccountingFacadeEJB getAccountingFacadeEJB()
throws NamingException {
InitialContext ctx = new InitialContext();
AccountingFacadeEJB accountingEJB = (AccountingFacadeEJB) ctx.lookup("AccountingFacadeEJBBean/remote");
return accountingEJB;
}
public boolean addStageTrack(Stagestracking track)
throws StagesTrackingException {
try {
AccountingFacadeEJB accounting = getAccountingFacadeEJB();
return accounting.addStageTrack(track);
}catch (NamingException e){
throw new BDAccountingException(e.getMessage());
}
}
}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@Stateless
@Remote
public class AccountingFacadeEJBBean implements Serializable {
@Resource(mappedName="java:/JmsXA")
private ConnectionFactory connectionFactory ;
@Resource(mappedName="queue/A")
private Queue queue;
@EJB
private AccountingDocumentsEJB accountingDocumentsEJB;
public boolean addStageTrack(Stagestracking track)
throws StagesTrackingException {
return accountingDocumentsEJB.addStageTrack(track);
}
}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@Stateless
@Local
public class AccountingDocumentsEJBBean implements AccountingDocuments, AccountingDocumentsEJB {
@IgnoreDependency
@EJB
private AccountingFacadeEJB accountingFacade;
public boolean addStageTrack(Stagestracking track)
throws StagesTrackingException {
try {
StagesTrackingDAO stagesTrackingDAO = getStagesTrackingDAO();
return stagesTrackingDAO.addStageTrack(track);
} catch (DAOException e) {
throw new EJBException(e.getMessage());
}
}
public boolean addStageTrack(Stagestracking track) throws DAOException {
boolean returnValue = false;
track.setId(new Long(378));
//At this time the variable has been modified
returnValue = true;
return returnValue;
}
}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks for advance.