[Zope] Re: SQLSession problem

Jochen Haeberle listen@MIDRAS.de
Sat, 12 Feb 2000 13:22:31 +0100


Anthony,

thanks for the tip, yes Base64online helps for Gadfly, but neither
does it for MySQL - okay, there were some things to change for MySQL
while building the db, but I guess I maged that:

First it is important to note that for MySQL the tables have to be
named Sessions and Session_date (case sensitive). The index on
Sessions.session is to be unique so the field must be set to not
null. The declaration of varchar needs a basic value (like
varchar(50)).
At least that's what I did and what works like described earlier, it
works for some entries to the list.

Another question, please:
I would like to use SQLSession in URLs like in Duncans HowTo
<http://www.zope.org/Members/Duncan/SessionURLs/> The HowTo builds on
SQLSession 0.2.2 with some changes to your code. I have 0.2.3 and it
seems that most of the changes proposed by Duncan are in SQLSession,
but it does not work for me. I get the following TraceBack

Session Error:

<!--
Traceback (innermost last):
   File /serve/MIS-Zope-2.1.3/lib/python/ZPublisher/Publish.py, line 
214, in publish_module
   File /serve/MIS-Zope-2.1.3/lib/python/ZPublisher/Publish.py, line 
179, in publish
   File /serve/MIS-Zope-2.1.3/lib/python/Zope/__init__.py, line 202, 
in zpublisher_exception_hook
     (Object: ElementWithAttributes)
   File /serve/MIS-Zope-2.1.3/lib/python/ZPublisher/Publish.py, line 
165, in publish
   File /serve/MIS-Zope-2.1.3/lib/python/ZPublisher/mapply.py, line 
160, in mapply
     (Object: index_html)
   File /serve/MIS-Zope-2.1.3/lib/python/ZPublisher/Publish.py, line 
102, in call_object
     (Object: index_html)
   File /serve/MIS-Zope-2.1.3/lib/python/OFS/DTMLMethod.py, line 145, 
in __call__
     (Object: index_html)
   File 
/serve/MIS-Zope-2.1.3/lib/python/DocumentTemplate/DT_String.py, line 
502, in __call__
     (Object: index_html)
   File /serve/MIS-Zope-2.1.3/lib/python/OFS/DTMLMethod.py, line 141, 
in __call__
     (Object: standard_html_header)
   File 
/serve/MIS-Zope-2.1.3/lib/python/DocumentTemplate/DT_String.py, line 
502, in __call__
     (Object: standard_html_header)
   File /serve/MIS-Zope-2.1.3/lib/python/DocumentTemplate/DT_Util.py, 
line 335, in eval
     (Object: Session(session_id=SessionID, noCookie=1, validSession=1))
     (Info: SessionID)
   File <string>, line 0, in ?
   File 
/serve/MIS-Zope-2.1.3/lib/python/Products/SQLSession/SQLSession.py, 
line 299, in __call__
     (Object: Session)
Session Error: Invalid session specified

-->

Is this due to incompatibilities of the HowTo and SQLSession 0.2.3 or
is it more probably my fault?

Jochen

At 9:29 Uhr +1100 12.02.2000, Anthony Baxter wrote:
>  >>> Jochen Haeberle wrote
>  > Hi,
>  >
>  > I am stuck with Anthonys SQlSession. I followed the HowTo on Using
>  > SQLSession by Miklos, trying to avoid the typos (too many
>  > "Session"/"Sessions", Miklos :-) and got set up using Gadfly. But
>  > after adding about 4 items to the list I get a Traceback:
>  >
>  > Error Type: LexTokenError
>  > Error Value: Lexical token not found near :: "w',\012 'bah',\012
>  > "*"'KGxwMQpTJ2RmZ2"
>
>looks like the gadfly newline-in-string thing again.
>
>Go to the properties of your SQLSession object and change the
>encoding from base64 to base64oneline. This removes the newlines
>from the base64 strings. Or else search the zope-list archives for
>the patch for gadfly (it's been posted multiple times, last time was
>about a week ago).
>
>Anthony