|
Home > Archive > WebSphere Commerce suite > January 2005 > Membergroup hell
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Andreas Holmberg 2005-01-21, 7:51 am |
|
I implemented the solution suggested by "John" concerning using membergroups
and tradingpositioncontainers (and TERMCOND, PARTICIPANT, CONTRACT) to give
users different pricelists. But I get very strange behaviors. I have setup
tracing on WC_USER and WC_ORDER. Here's what I do to reprodce the problem:
1. Log on with user "US_USR1" in the "US Market group" (mbrgrp_id=1101)
2. Search and view product in store with "US_USR1". The log shows that
getBaseUnitPriceCmdImpl.getMemberGroups() returns the correct mbrgrp_id =
1101.
3. Logon with "DE_USR1" in "German Market Group" (mbrgrpId=1121) from a
different computer.
4. Search and view product in store with "DE_USR1". The log shows that
getBaseUnitPriceCmdImpl.getMemberGroups() returns the correct mbrgrp_id =
1121.
5.Search and view product in store with "US_USR1" on the first computer. The
log now shows that getBaseUnitPriceCmdImpl.getMemberGroups() returns the
INCORRECT mbrgrp_id = 1121!!!! This results in that a price is returned from
the wrong tradingposition and in the wrong currency and the application
fails with "UnabletoretrievepriceException" or something like that.
There is no row in MBRGRPMBR where user "US_USR1" is member of the German
market group!. Seems like the membergroup_id that is returned is from the
user that logged in last.
I checked the code for getBaseUnitPriceCmdImpl that is delivered in 5.6.0.2
PRO Developer Edition and it seems like there's a problem somewhere in this
code:
private Long[] getMemberGroupIds() throws ECSystemException {
final String methodName = "getMemberGroups";
ECTrace.entry(ECTraceIdentifiers.COMPONENT_ORDER, iClassName, methodName);
try {
if (iMemberGroupIds == null) {
UserAccessBean userAB = commandContext.getUser();
//@@D30756 - don't get member groups if this is a generic shopper
if (!userAB.getUserId().equals(ECConstants.EC_GENERIC_USER_REFNUM)) {
Integer storeId = getStoreAB().getStoreEntityIdInEJBType();
// MemberGroupMemberAccessBean memberGroupsAB = new
MemberGroupMemberAccessBean();
// Enumeration memberGroupsEnum =
memberGroupsAB.findAllStoreGroupMember(getStoreAB().getStoreEntityIdInEJBType(),
commandContext.getUserId());
Vector memberGroupsVector = userAB.getAllStoreGroupMembers(storeId);
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
ECTrace.trace(
ECTraceIdentifiers.COMPONENT_ORDER,
iClassName,
methodName,
"userId = " + userAB.getUserId() + ", storeId = " + storeId);
// create an array from vector
int size = memberGroupsVector.size();
if (size > 0) {
iMemberGroupIds = new Long[size];
// create array
for (int i = 0; i < size; i++) {
MemberGroupMemberAccessBean memberGroup =
(MemberGroupMemberAccessBean) memberGroupsVector.elementAt(i);
iMemberGroupIds[i] = memberGroup.getMbrGrpIdInEJBType();
ECTrace.trace(ECTraceIdentifiers.COMPONENT_ORDER, iClassName,
methodName, "memberGroupId = " + iMemberGroupIds[i]); <<<<<<<<<<<< This
line is seen in trace.log with wrong membergroup id!!!!
}
}
}
}
} catch (javax.ejb.CreateException ex) {
throw new ECSystemException(ECMessage._ERR_CREATE_EXCEPTION, iClassName,
methodName, ex);
} catch (javax.ejb.FinderException ex) {
throw new ECSystemException(ECMessage._ERR_FINDER_EXCEPTION, iClassName,
methodName, ex);
} catch (javax.naming.NamingException ex) {
throw new ECSystemException(ECMessage._ERR_GENERIC, iClassName,
methodName, ex);
} catch (java.rmi.RemoteException ex) {
throw new ECSystemException(ECMessage._ERR_REMOTE_EXCEPTION, iClassName,
methodName, ex);
}
ECTrace.exit(ECTraceIdentifiers.COMPONENT_ORDER, iClassName, methodName);
return iMemberGroupIds;
}
ANY SUGGESTIONS? I think I have to call IBM...
Regards,
Andreas
| |
|
| Yeah... I feel your pain. I spent a while trying to get this working
and at the time I didn't have enough Java knowledge to roll my own
pricing logic to make this work. I read a post (by Geo, I believe)
that said he rolled his own code for doing group pricing. I have the
xml files that I used to create the database entries to make group
pricing work on my system. At the very least they might give you an
idea of the tables/fields that you have to populate and it might help
you verify that you have your records linked properly. If you want
this file email me offline at johnmg@owls.com and I will provide it to
you.
- John
On Fri, 21 Jan 2005 13:57:20 +0100, "Andreas Holmberg"
<holmba.nospam@hotmail.com> wrote:
>
>
>I implemented the solution suggested by "John" concerning using membergroups
>and tradingpositioncontainers (and TERMCOND, PARTICIPANT, CONTRACT) to give
>users different pricelists. But I get very strange behaviors. I have setup
>tracing on WC_USER and WC_ORDER. Here's what I do to reprodce the problem:
>
>1. Log on with user "US_USR1" in the "US Market group" (mbrgrp_id=1101)
>2. Search and view product in store with "US_USR1". The log shows that
>getBaseUnitPriceCmdImpl.getMemberGroups() returns the correct mbrgrp_id =
>1101.
>3. Logon with "DE_USR1" in "German Market Group" (mbrgrpId=1121) from a
>different computer.
>4. Search and view product in store with "DE_USR1". The log shows that
>getBaseUnitPriceCmdImpl.getMemberGroups() returns the correct mbrgrp_id =
>1121.
>5.Search and view product in store with "US_USR1" on the first computer. The
>log now shows that getBaseUnitPriceCmdImpl.getMemberGroups() returns the
>INCORRECT mbrgrp_id = 1121!!!! This results in that a price is returned from
>the wrong tradingposition and in the wrong currency and the application
>fails with "UnabletoretrievepriceException" or something like that.
>
>There is no row in MBRGRPMBR where user "US_USR1" is member of the German
>market group!. Seems like the membergroup_id that is returned is from the
>user that logged in last.
>
>I checked the code for getBaseUnitPriceCmdImpl that is delivered in 5.6.0.2
>PRO Developer Edition and it seems like there's a problem somewhere in this
>code:
>
>
>
>private Long[] getMemberGroupIds() throws ECSystemException {
> final String methodName = "getMemberGroups";
> ECTrace.entry(ECTraceIdentifiers.COMPONENT_ORDER, iClassName, methodName);
> try {
> if (iMemberGroupIds == null) {
> UserAccessBean userAB = commandContext.getUser();
>
> //@@D30756 - don't get member groups if this is a generic shopper
> if (!userAB.getUserId().equals(ECConstants.EC_GENERIC_USER_REFNUM)) {
> Integer storeId = getStoreAB().getStoreEntityIdInEJBType();
> // MemberGroupMemberAccessBean memberGroupsAB = new
>MemberGroupMemberAccessBean();
> // Enumeration memberGroupsEnum =
>memberGroupsAB.findAllStoreGroupMember(getStoreAB().getStoreEntityIdInEJBType(),
>commandContext.getUserId());
> Vector memberGroupsVector = userAB.getAllStoreGroupMembers(storeId);
><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> ECTrace.trace(
> ECTraceIdentifiers.COMPONENT_ORDER,
> iClassName,
> methodName,
> "userId = " + userAB.getUserId() + ", storeId = " + storeId);
>
> // create an array from vector
> int size = memberGroupsVector.size();
> if (size > 0) {
> iMemberGroupIds = new Long[size];
>
> // create array
> for (int i = 0; i < size; i++) {
> MemberGroupMemberAccessBean memberGroup =
>(MemberGroupMemberAccessBean) memberGroupsVector.elementAt(i);
> iMemberGroupIds[i] = memberGroup.getMbrGrpIdInEJBType();
> ECTrace.trace(ECTraceIdentifiers.COMPONENT_ORDER, iClassName,
>methodName, "memberGroupId = " + iMemberGroupIds[i]); <<<<<<<<<<<< This
>line is seen in trace.log with wrong membergroup id!!!!
> }
> }
> }
> }
> } catch (javax.ejb.CreateException ex) {
> throw new ECSystemException(ECMessage._ERR_CREATE_EXCEPTION, iClassName,
>methodName, ex);
> } catch (javax.ejb.FinderException ex) {
> throw new ECSystemException(ECMessage._ERR_FINDER_EXCEPTION, iClassName,
>methodName, ex);
> } catch (javax.naming.NamingException ex) {
> throw new ECSystemException(ECMessage._ERR_GENERIC, iClassName,
>methodName, ex);
> } catch (java.rmi.RemoteException ex) {
> throw new ECSystemException(ECMessage._ERR_REMOTE_EXCEPTION, iClassName,
>methodName, ex);
> }
> ECTrace.exit(ECTraceIdentifiers.COMPONENT_ORDER, iClassName, methodName);
>
> return iMemberGroupIds;
>}
>
>
>
>ANY SUGGESTIONS? I think I have to call IBM...
>
>
>Regards,
>Andreas
>
| |
|
| If you theory is that the membergroup_id is obtained from the last
user that logged in then perhaps you could try doing the reverse of
what you did before and see if your theory holds up. My hunch is that
pricing is just not configured properly. When I was getting this to
work I also tried tracing the logs and decompiling code. It turned
out the the code was fine and I just had to tweak the data that I had
inserted into the db.
- John
On Fri, 21 Jan 2005 13:57:20 +0100, "Andreas Holmberg"
<holmba.nospam@hotmail.com> wrote:
>
>
>I implemented the solution suggested by "John" concerning using membergroups
>and tradingpositioncontainers (and TERMCOND, PARTICIPANT, CONTRACT) to give
>users different pricelists. But I get very strange behaviors. I have setup
>tracing on WC_USER and WC_ORDER. Here's what I do to reprodce the problem:
>
>1. Log on with user "US_USR1" in the "US Market group" (mbrgrp_id=1101)
>2. Search and view product in store with "US_USR1". The log shows that
>getBaseUnitPriceCmdImpl.getMemberGroups() returns the correct mbrgrp_id =
>1101.
>3. Logon with "DE_USR1" in "German Market Group" (mbrgrpId=1121) from a
>different computer.
>4. Search and view product in store with "DE_USR1". The log shows that
>getBaseUnitPriceCmdImpl.getMemberGroups() returns the correct mbrgrp_id =
>1121.
>5.Search and view product in store with "US_USR1" on the first computer. The
>log now shows that getBaseUnitPriceCmdImpl.getMemberGroups() returns the
>INCORRECT mbrgrp_id = 1121!!!! This results in that a price is returned from
>the wrong tradingposition and in the wrong currency and the application
>fails with "UnabletoretrievepriceException" or something like that.
>
>There is no row in MBRGRPMBR where user "US_USR1" is member of the German
>market group!. Seems like the membergroup_id that is returned is from the
>user that logged in last.
>
>I checked the code for getBaseUnitPriceCmdImpl that is delivered in 5.6.0.2
>PRO Developer Edition and it seems like there's a problem somewhere in this
>code:
>
>
>
>private Long[] getMemberGroupIds() throws ECSystemException {
> final String methodName = "getMemberGroups";
> ECTrace.entry(ECTraceIdentifiers.COMPONENT_ORDER, iClassName, methodName);
> try {
> if (iMemberGroupIds == null) {
> UserAccessBean userAB = commandContext.getUser();
>
> //@@D30756 - don't get member groups if this is a generic shopper
> if (!userAB.getUserId().equals(ECConstants.EC_GENERIC_USER_REFNUM)) {
> Integer storeId = getStoreAB().getStoreEntityIdInEJBType();
> // MemberGroupMemberAccessBean memberGroupsAB = new
>MemberGroupMemberAccessBean();
> // Enumeration memberGroupsEnum =
>memberGroupsAB.findAllStoreGroupMember(getStoreAB().getStoreEntityIdInEJBType(),
>commandContext.getUserId());
> Vector memberGroupsVector = userAB.getAllStoreGroupMembers(storeId);
><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> ECTrace.trace(
> ECTraceIdentifiers.COMPONENT_ORDER,
> iClassName,
> methodName,
> "userId = " + userAB.getUserId() + ", storeId = " + storeId);
>
> // create an array from vector
> int size = memberGroupsVector.size();
> if (size > 0) {
> iMemberGroupIds = new Long[size];
>
> // create array
> for (int i = 0; i < size; i++) {
> MemberGroupMemberAccessBean memberGroup =
>(MemberGroupMemberAccessBean) memberGroupsVector.elementAt(i);
> iMemberGroupIds[i] = memberGroup.getMbrGrpIdInEJBType();
> ECTrace.trace(ECTraceIdentifiers.COMPONENT_ORDER, iClassName,
>methodName, "memberGroupId = " + iMemberGroupIds[i]); <<<<<<<<<<<< This
>line is seen in trace.log with wrong membergroup id!!!!
> }
> }
> }
> }
> } catch (javax.ejb.CreateException ex) {
> throw new ECSystemException(ECMessage._ERR_CREATE_EXCEPTION, iClassName,
>methodName, ex);
> } catch (javax.ejb.FinderException ex) {
> throw new ECSystemException(ECMessage._ERR_FINDER_EXCEPTION, iClassName,
>methodName, ex);
> } catch (javax.naming.NamingException ex) {
> throw new ECSystemException(ECMessage._ERR_GENERIC, iClassName,
>methodName, ex);
> } catch (java.rmi.RemoteException ex) {
> throw new ECSystemException(ECMessage._ERR_REMOTE_EXCEPTION, iClassName,
>methodName, ex);
> }
> ECTrace.exit(ECTraceIdentifiers.COMPONENT_ORDER, iClassName, methodName);
>
> return iMemberGroupIds;
>}
>
>
>
>ANY SUGGESTIONS? I think I have to call IBM...
>
>
>Regards,
>Andreas
>
|
|
|
|
|