I've done that for Kickstart to support the session-per-request pattern. You
need a custom PropertyPersistenceStrategy using your squeezer.

Before releasing it I wanted to make optimistic locking work - I'm storing
Entity-Name, id and Version on the client. Somehow Hibernate seems to
dislike it when I update the version of a newly loaded object to the "old"
value.

Maybe I'll release it anyway these days and file a bug for the optimistic
lock ...

> -----Original Message-----
> From: James Carman [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 20, 2006 5:08 PM
> To: 'Tapestry users'
> Subject: RE: Squeezer-based Property Persistence...
> 
> 
> What I have written is a HibernateEntitySqueezer implementation that
> basically just writes out the "entityName" and the "id" of 
> the entity.  When
> it comes back up, I use the Hibernate Session to restore the 
> object.  This
> way, I don't have a problem with detached objects.  It works 
> pretty well.  I
> actually implemented it in another way, but I was wondering 
> if someone had
> come up with an implementation that leans on the squeezer 
> stuff.  I'm not
> really concerned with writeFloat, writeUTF, etc.  The 
> entityName/id doesn't
> take up that much space and it's somewhat constant in size.  Thanks!
> 
> James
> 
> -----Original Message-----
> From: Andreas Andreou [mailto:[EMAIL PROTECTED] 
> Sent: Monday, February 20, 2006 10:54 AM
> To: Tapestry users
> Subject: Re: Squeezer-based Property Persistence...
> 
> I was actually messing with this 2 days ago.
> I created a custom impementation of
> PersistentPropertyDataEncoder
> that instead of using ObjectOutputStream.writeObject (in
> writeChangesToStream )
> checks the type of the object and outputs a prefix + accordingly uses
> ObjectOutputStream.writeFloat, ObjectOutputStream.writeUTF,
> ObjectOutputStream.writeLong e.t.c.
> It also handles nulls by using a special prefix.
> Anyway, by using this approach, i got the Base64 encoded 
> string down to 1/3
> of its size.
> I was also thinking of injecting the DataSqueezer in my custom
> PersistentPropertyDataEncoder
> but the squeezer turns object to strings and this cannot take 
> advantage
> of the writeLong,
> writeFloat e.t.c. methods of the ObjectOutputString.
> 
> Perhaps these 2 modules need a bit of refactoring in order for one to
> make use of the other.
> 
> 
> >All,
> >
> >I have been going crazy trying to figure out why my 
> client-persisted page
> >properties aren't being "unsqueezed" by my custom squeezer.  
> Well, it's
> >because Tapestry doesn't use the "squeezer" to store 
> client-persisted page
> >properties
> >(http://mail-archives.apache.org/mod_mbox/jakarta-tapestry-de
v/200507.mbox/
%
>[EMAIL PROTECTED]).  Has anyone ever
>implemented a SqueezerPropertyPersistenceStrategy?  What I'm trying to do
is
>merely write the id of an entity object out to the client and use that to
>reconstruct the object when it comes back up (using Hibernate of course).
>
>James
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to