[Grok-dev] Data.fs grow as result of create and remove principal

Jens Adner j.adner at fh-sm.de
Fri Mar 13 05:03:32 EDT 2009


Hi Sebastian,

sounds like another nice feature of zope.

But I have a lot of logins a day, and every time the ZODB is growing
500Byte. Days later, the ZODB is very large just storing session data.

Maybe I can switch the persistent session to a RAM session. Loosing the
sessions after restart zope is useful but not so important (for my app).

Jens


Sebastian Ware schrieb:
> The sessions are persistent and stored in the ZODB by default. You can
> restart the server and all the sessions are still active. This is very
> useful.
> 
> Mvh Sebastian
> 
> 11 mar 2009 kl. 10.55 skrev Jens Adner:
> 
>> Hi there,
>>
>> my app is on a good way, all fine, ldap-auth is working and I am happy
>> with grok.
>>
>> There is one small problem left I have. But it's not a real problem.
>>
>> The problem is, Data.fs is growing every time a principal is greating or
>> removing by logging in or out.
>>
>> This is my code:
>>
>> app.py
>> ---------------------------------------------------------------------
>> class Foo(grok.Application, GlobalContainer):
>>
>>   grok.local_utility(ldapauth.LdapAuth,
>>                     provides=IAuthenticatorPlugin,name='ldapauth2')
>>   grok.local_utility(ldapauth.MyCreds,
>>                     provides=ICredentialsPlugin,name='loginform2')
>>
>>   grok.local_utility(ldapauth.MyPau,provides=IAuthentication)
>> ---------------------------------------------------------------------
>>
>> and
>>
>> ldapauth.py
>> ---------------------------------------------------------------------
>> ...
>> from zope.app.authentication.session import SessionCredentialsPlugin
>>
>> class LdapAuth(ldappas.authentication.LDAPAuthentication):
>>  def __init__(self):
>>    self.adapterName = 'fhsLdapAdapter'
>>    self.searchBase = 'dc=fh-sm,dc=de'
>>    ...
>>
>> class MyCreds(SessionCredentialsPlugin):
>>  pass
>>
>> class MyPau(authentication.PluggableAuthentication):
>>  def __init__(self):
>>    super(MyPau,self).__init__()
>>    self.credentialsPlugins = ('loginform2',)
>>    self.authenticatorPlugins = ('ldapauth2',)
>>    self.prefix = u'pau2.'
>>
>> ----------------------------------------------------------------------
>>
>>
>> and in addition I create roles and perms:
>>
>> -----------------------------------------------------
>> ...
>> @grok.subscribe(IPrincipalCreated)
>> def update_principal_info_from_ldap(event):
>> principal = event.principal
>> app = grok.getSite()
>> ....
>> -----------------------------------------------------
>>
>> Data.fs is growing after login and logout about 500 Byte or so.
>>
>> I can pack the Data.fs with self.request.publication.db.pack(), but this
>> is not the best way.
>>
>>
>> My Question is, why Data.fs grow? I don't create Data in my app. I think
>> this is a session problem, maybe the session will create in Data.fs, not
>> in RAM.
>>
>> Thx for your help
>> Jens
>>
>> -- 
>> ++++++++ Jens Adner IuK-Zentrum Fachhochschule Schmalkalden +++++++++
>> ++++++++ Fon: +49 3683688 9201  Fax: +49 3683688 989201     +++++++++
>> _______________________________________________
>> Grok-dev mailing list
>> Grok-dev at zope.org
>> http://mail.zope.org/mailman/listinfo/grok-dev
> 

-- 
++++++++ Jens Adner IuK-Zentrum Fachhochschule Schmalkalden +++++++++
++++++++ Fon: +49 3683688 9201  Fax: +49 3683688 989201     +++++++++


More information about the Grok-dev mailing list