CustomerID jumps from 1 to 591 for only 8 registred users

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
a.m. wrote:
I don't think that loading all customer identifiers in memomy is a good idea. I would better implement it as a stored procedure:

1. Insert a record into [Customer] record with a stored procedure. Put all ID calculation and IDENTITY_INSERT logic there
2. Return a customer record from this stored procedure
3. Use this record in application to assign it to Guest customer role and any other logic

P.S. There's one more solution. But it'll require much more core changes. Do not use ID column in Customer table and make CustomerGuid as a primary key


I agree this is the best way to implement it. Database related issues should be handled on the database level. To minimize code changes, is it possible to do a sproc call at the end of DeleteGuestCustomers instead of being called upon Customer insertion? In this case, the sproc should be responsible for migrating individual customers with an Id of a  large value to an Id of a smaller value in order to close gaps, loop through customers, and then reseed the identity. Is there any possible drawback in updating the Id of a registered customer? Just asking.
11 years ago
hezyz wrote:
if someone wishes to buy something he will register
ant attempt to go to cart will redirect to login page


hezyz, have you read this before? It was posted on this forum. It tells the experience of an online store with enforcing users to register prior to checkout.

http://www.uie.com/articles/three_hund_million_button/

Thanks.
11 years ago
Hello, my solution is working very well, and you guys not need to prevent anyone put products into your cart, Disable this function would be stupid, because many users use the ecommerce shopping cart as a tool to decide whether or not to buy. another case. registered  user accesses the site without being logged in, decide to purchase some items, but not logged, it can not do before you log in, its a bit frustrating user experience...
11 years ago
Hi Folks

I would like to give my feedback about the solution proposed here.
Hopefully this will be helpful for someone else that will not lose the mind like me in the last hours.

Well I tried the solution proposed here on a 2.65 version with activated the "EU Cookie Warning" and "OpenID External Authentication". The result was that new guest was not recorded in the database, but there were also side effects that have brought me back the the original release.

1° problem: the "EU Cookie Warning" have stop to work, I have also try to delete the internet temporary file with cookies, nothing doesn't work!

2° problem: OpenID have stop to work, I have made test to register a new user and the website was not able to accept at all the registration giving back "The Search engine can't be registered" or something of similar.

3° problem: random selection of the user language. The website have 6 languages and every-time that I was loading the homepage someone randomly was selected! This was the last thing that have make me feel totally disheartened.


So before to jump with this solution my suggestion is to consider if one of the 3 point posted here can be important for you.

However if someone else can suggest a solution that is totally compliant and doesn't bring side effects, please let me know.
11 years ago
Is there any solution to this being implemented into nopCommerce v3

Maybe extra options in the back end to use sessions or reseed maybe helpful to some?

At first glance using sessions seems like a good solution, however unless your using a seperate session state server this could slow down the performance of the webserver if lots of sessions are being used? The flip side of using the database instead could still slow things down the site. I think either way there will be performance issues. However Sessions use memory but databases use memory and disk space.

Thinking about this a bit more, personally I think items should only be stored in the database if they are meant to be permanently stored there. All other activity should be cached via sessions. The sessions can be disposed of easy enough once not needed, after all they are meant to be temporary as is guest information.

ASP.Net already uses large view state bags to pass back information between post backs, a few extra bytes should not make too much difference.

Kind Regards
Julian
11 years ago
JulianMummery wrote:
Is there any solution to this being implemented into nopCommerce v3



The only improvement that I am aware of is that scheduled tasks such as KeepAlive are now run by a specific system user that was created for this purpose. This should reduce the number of guest users created.
11 years ago
Maverjk wrote:

2° problem: OpenID have stop to work, I have made test to register a new user and the website was not able to accept at all the registration giving back "The Search engine can't be registered" or something of similar.

3° problem: random selection of the user language. The website have 6 languages and every-time that I was loading the homepage someone randomly was selected! This was the last thing that have make me feel totally disheartened.

Hi,
My solution tries to promote a concept that any user who does not perform an action that is interesting to insert a row in the database,it will not!! However, we must consider all actions that we want to save a new guestcustomer row . note that one of the parts to be modified are: shoppingcart, register, and maybe, in your case, language choice, openID plugin, etc..

is easy to understand, if who is trying to "openid" is a searchengine, force to create a new record. The same code should be used as explained in the case of Register () {}

look at my other posts..

I advise you to set to empty the record like email  of searchengine,  and you can use a standard language, and when someone choose a new language u adds a new guest.
Remember in customerservice to  ensure that serachengine do not do updates  
  public virtual void UpdateCustomer(Customer customer)
{
if (!customer.IsSearchEngineAccount())
            {
          
                _customerRepository.Update(customer);

            }

}
11 years ago
Hello leandromugnol

I have personally test your solution following all your steps and actually works, but as I have said there are differents side effects. Thanks however for your suggestions.
I think at this point your approach is not suitable for me. Unfortunately involves too many changes.

@Julian: I have quite interest instead in your solution.
Any clue to implements it in a easy way?
11 years ago
I am unfamiliar with MVC. Most of my experience comes from a VB.Net / ASP.Net background so am not in a position to make changes like this. Using Sessions as temporary storage for user information makes sense to me and one it needs to be made permanent then write it to the database.

At a glance I think it would require quite a lot of work tom implement.

Maybe someone that knows nopCommerce code inside out is in a better position to comment.
10 years ago
r_omar wrote:
if someone wishes to buy something he will register
ant attempt to go to cart will redirect to login page

hezyz, have you read this before? It was posted on this forum. It tells the experience of an online store with enforcing users to register prior to checkout.

http://www.uie.com/articles/three_hund_million_button/

Thanks.


Thanks for sharing this link. Its very useful.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.