NetTalk Central

Author Topic: Where populate an immemory  (Read 3311 times)

capora56

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Where populate an immemory
« on: February 18, 2015, 04:31:37 AM »
Hi all
I developed a web server application based in a file that has 39000 registers. All works fine. But due i need to order the browse in a special format i decided to use an inmemory file in which i can add special fields for doing the special order. I added a field SessionID in the inmemory file to save the session id,ok
I populate the inmemory in the 1.Generate browse embed point, this works fine, but when i try to make a second access to the web browse (for example from my ipad) the server gives me a duplicated key error, i suppose that is because it is populating the data in the immemory file twice.
My question is where is convenient populate the inmemory, is there a place where it populates only one time for all the conections or i'm wrong width this concept. ?
I try to compare how works the browse over a disk file and over an imemory file but don't understand how it is
Other thing that i noted, using a browse disk file is faster comparing with the inmemory use
It's correct what i'm doing ? I hope you understand my problem
Thank you
Ruben Caporossi

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: Where populate an immemory
« Reply #1 on: February 18, 2015, 02:22:55 PM »
Hi, Ruben

I use InMemory tables a lot and the only time I get this kind of problem is when I inadvertently try to populate the table a second time with the same data.   The SessionID would not be a unique key in your InMemory table,  so the unique key that is generating the error is something else. Try doing a p_web._Trace with the unique key fields just before you add the record in your populating procedure and see what values were trying to be added when you generate the error.  You probably need to add the SessionID field to each unique key you want to use in the InMemory table.

Hope that helps. 

capora56

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Re: Where populate an immemory
« Reply #2 on: February 18, 2015, 03:09:02 PM »
Thanks for your response CaseyR
The problem is that the original file is untouchable, but I could define in the inmemory  a new key that involves the sessionid. I'll try this ...
Ruben Caporossi

capora56

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Re: Where populate an immemory
« Reply #3 on: February 18, 2015, 03:21:34 PM »
Great !!! it's work fine adding SessionID to the unike key of the inmemory file
Thank you very much CaseyR