I only have one ObjectStore object, but it will be handling
persistance for several hundred other objects.  Here's the code that
was causing the problem (after I made a change to the ObjectStore code
to make it work with the newer python/mysql lib per instructions
earlier in this thread):

import os, sys
sys.path.insert(1, os.path.abspath(os.pardir))

from mx.DateTime import DateFrom
from MiddleKit.Run.MySQLObjectStore import MySQLObjectStore
from NetSession import NetSession

def main():
        # Set up the store
        store = MySQLObjectStore(user='', passwd='')
        store.readModelFileNamed('proto1.mkmodel')

        for x in range(1,255):
                s = NetSession()
                s.setUserId(x)
                store.addObject(s)

        store.saveChanges()

if __name__=='__main__':
        main()

Thanks!
-jacob

On Tue, 25 Jan 2005 18:24:29 -0500, Winston Wolff
<[EMAIL PROTECTED]> wrote:
> How many ObjectStore objects do you have living?  I believe you are
> only supposed to have one instance for your entire application.  I had
> a lot of trouble with running out of connections when I first started
> using MiddleKit, and as I recall I fixed it by making a global
> MySQLObjectStore instance.
> 
> -winston
>


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to