It is fixed in the CVS. Thanks.

Boulatian, Misak wrote:

Hi Adrian,

Hi Adrian,

Here is the trace you asked for.

Search for string 'MISAK: default account=00000001' that comes right after
create(). This one sets default account on remote interface. The string
'MISAK: active account=00000001' is the result of the get method that proves
the successful completion of set method. When you see the lines after this
string you will notice that store commands for AutoNumber and VoltsSession
not executed claiming that entity is not dirty although it is. Since those
values are not written to the database then the following function fails
(Search for string 'MISAK: inside account balances' where that function
starts: method getActiveAccount fails to retrieve.) Here is the code snipet
that performs those functions of create and store afterwards:

BEGIN SNIPET
VoltsSessionState voltsSessionState = new VoltsSessionState();
voltsSessionState.setVoltsContextId(-1l);
voltsSessionState.setApplicationUserId(userState.getApplicationUserId());
voltsSessionState.setBrokerageId(userState.getBrokerageId());
voltsSessionState.setProfileId(userState.getProfileId());
voltsSessionState.setLastAccessDateTime(today);
String firmCurrency = brokerageState.getDefaultCurrency();
voltsSessionState.setFirmCurrency(firmCurrency);
String displayCurrency = userState.getDisplayCurrency();
if (displayCurrency == null || displayCurrency.length() == 0) {
// default to the firm currency
voltsSessionState.setDisplayCurrency(firmCurrency);
} else {
voltsSessionState.setDisplayCurrency(displayCurrency);
}


if (userState.getUserType() ==
VoltsConstants.ApplicationUser.INVESTOR) {
// Investors
voltsSessionState.setTimeoutLimit(brokerageState.getInvestorTimeoutLimit());
voltsSession = voltsSessionHome.create(voltsSessionState);
internalLogger.debug("MISAK: default account=" +
userState.getDefaultAccountId());


voltsSession.setActiveAccountId(userState.getDefaultAccountId());

internalLogger.debug("MISAK: active account=" +
voltsSession.getActiveAccountId());
                // See if there's an account currency for the active
account, and cache it in
                // VoltsSession if so...
                Account account = accountHome.findByPrimaryKey(new
AccountKey(userState.getDefaultAccountId()));
                String accountCurrency = account.getAccountCurrency();

if (accountCurrency == null || accountCurrency.length() == 0) {
// default to the firm currency
voltsSession.setActiveAccountCurrency(brokerageState.getDefaultCurrency());
} else {
voltsSession.setActiveAccountCurrency(accountCurrency);
}
END SNIPET


As you can see from this code I call entity bean create with a state object.
Right after create I do set on the returned remote reference and do get to
make sure that set was successful. But result is not written to the database
claiming that the bean is not dirty.  It seams like ejbStore is called when
it should not been called: check for dirty flag first before calling it. In
my case the message 'MISAK: ejbStore is called' is printed inside ejbStore()
then it complains about being not dirty. Everything works fine with commit
option A or B.

This behavior is not the same with 3.2.1. Everything works as supposed to. A couple of words about my entity beans and the environment:
- Still ejb 1.1 compliant.
- Are used within the context ejb2.0 dtd with cmp-version=1.x
- Have 'private boolean modified' variable that is incremented in every set
method. No function isModified().
- Worked fine with all previous releases of Jboss up to and including 3.2.1.
Problem started with 3.2.2.
- Sybase ASE 12.5 used as our DBMS.


One more thing. The boolean modified flag in my entity beans is set to true
in every set method and is reset in ejbStore(). Based on this it seems like
you call ejbStore then check for dirty. But in ejbStore we reset modified
flag. That is why you don't see it as dirty. But still everything works fine
with commit options A and B.

        public void setActiveAccountId(String activeAccountId) {
                this.activeAccountId = activeAccountId;
                modified = true;
        }
        public void ejbStore() {
System.out.println("MISAK: ejbStore is called");
                modified = false;
        }

Thanks,
Misak

_
This message and any attachments are intended only for the use of the addressee and
may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.




-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to