Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Server data persistance??

0 views
Skip to first unread message

Bradley Corner

unread,
Jul 17, 1997, 3:00:00 AM7/17/97
to

Ive written a client/server using TCP. the client sends data to the
server. this data is either a query structure or an update structure.
The server loads a table from a flat file and stores it into an
associative array using a customer # as the index. What I want to
happen is when the update structure contains a customer # which matches
one in the associative array I want it to update the associative array.
The intention is to enable me to do record level locking with the data
in the associative array. The problem I am having is when the child
closes and the next child is spawned the array doesnt reflect the
change. Even though I can print out the record in the associative array
just prior to opening a new passive socket. How can I gain persistance
in the array from one client call to the next?

Thank you for any assistance.. A fellow Perl programmer....


--

#################

#######################################################
###########################################################################
| "The REAL ESTATE Listing Service of NE Florida"
+--+--+ |
| Northeast Florida Multiple +-----+ e-mail: b...@nefmls.com
|__|__| |
| Listing Service, Inc | + | Voice: (904) 296-6121 | |
| |
| 4651 Salisbury Rd.S. Ste 165 | .| Fax: (904) 296-6181
+--+--+ |
| Jacksonville, FL. 32256 | |
<URL:http://www.nefmls.net> |
|_________________________________________________________________________|

Doug Seay

unread,
Jul 17, 1997, 3:00:00 AM7/17/97
to

Bradley Corner wrote:
>
> Ive written a client/server using TCP. the client sends data to the
> server. this data is either a query structure or an update structure.
> The server loads a table from a flat file and stores it into an
> associative array using a customer # as the index. What I want to
> happen is when the update structure contains a customer # which matches
> one in the associative array I want it to update the associative array.
> The intention is to enable me to do record level locking with the data
> in the associative array. The problem I am having is when the child
> closes and the next child is spawned the array doesnt reflect the
> change. Even though I can print out the record in the associative array
> just prior to opening a new passive socket. How can I gain persistance
> in the array from one client call to the next?

The memory image should still be good from transaction to transaction
assuming that the server isn't restarted and the hash table stays in
scope. If you are sure that the hash table was in fact updated, then
either your server restarted or your hash table went out of scope. Are
you rereading your flat file for each connection and clobbering what is
already there?

Your problem with persistance is that, from your description, you never
save anything to disk. Next time you restart your server, all of your
changes will be lost. If you don't care about the file being human
readable (maybe you do, maybe that is why it is a flat file), try using
a DBM_File so you hash is actually going to disk to get the info. That
is the easiest way to have a hash and persistance.

- doug

0 new messages