You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Graeme Knight <gr...@gmail.com> on 2008/11/10 22:23:20 UTC

IDataProvider and Session related data.

Hi. 

Just learning about IDataProvider and DataViews.

I've scoped out the repeaters examples but this may be a little different...

If I have a userId (for example stored in the Session) of the user as he is
logged in and I wish to use that userId as a criteria for getting hold of
the correct data using a IDataProvider (for a DataView list), then should I
pass in the userID to the IDataProvider implementation and just store as a
private variable? 

Is there a better way of getting hold of (or passing this) information into
the IDataProvider implementation to limit storage/serialization?

Many thanks, Graeme.
-- 
View this message in context: http://www.nabble.com/IDataProvider-and-Session-related-data.-tp20428354p20428354.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: IDataProvider and Session related data.

Posted by Jeremy Thomerson <je...@wickettraining.com>.
In the data provider, you can do:
YourCustomSession.get().getUser().getID().  Then this doesn't have to be
serialized with the data provider, granted the cost will be very small.

-- 
Jeremy Thomerson
http://www.wickettraining.com

On Mon, Nov 10, 2008 at 3:23 PM, Graeme Knight <gr...@gmail.com> wrote:

>
> Hi.
>
> Just learning about IDataProvider and DataViews.
>
> I've scoped out the repeaters examples but this may be a little
> different...
>
> If I have a userId (for example stored in the Session) of the user as he is
> logged in and I wish to use that userId as a criteria for getting hold of
> the correct data using a IDataProvider (for a DataView list), then should I
> pass in the userID to the IDataProvider implementation and just store as a
> private variable?
>
> Is there a better way of getting hold of (or passing this) information into
> the IDataProvider implementation to limit storage/serialization?
>
> Many thanks, Graeme.
> --
> View this message in context:
> http://www.nabble.com/IDataProvider-and-Session-related-data.-tp20428354p20428354.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: IDataProvider and Session related data.

Posted by Graeme Knight <gr...@gmail.com>.
Hey guys,

Thanks! Being dumb I forgot about YourCustomSession.get().getUser().getID()
for the second time this week (and yes, its only Monday)!!!!

That totally answers my questions!

Cheers, Graeme.


Graeme Knight wrote:
> 
> Hi. 
> 
> Just learning about IDataProvider and DataViews.
> 
> I've scoped out the repeaters examples but this may be a little
> different...
> 
> If I have a userId (for example stored in the Session) of the user as he
> is logged in and I wish to use that userId as a criteria for getting hold
> of the correct data using a IDataProvider call to a database (for a
> DataView list), then should I pass in the userID to the IDataProvider
> implementation and just store as a private variable? 
> 
> Is there a better way of getting hold of (or passing this) information
> into the IDataProvider implementation to limit storage/serialization?
> 
> Many thanks, Graeme.
> 

-- 
View this message in context: http://www.nabble.com/IDataProvider-and-Session-related-data.-tp20428354p20429027.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Question on PageMap

Posted by Erik van Oosten <e....@grons.nl>.
> I am not sure what the default is set to
Look at the constructors of DiskPageStore.

> My end goal is to try and squeeze more performance out of my application.
If that is your goal you are on the wrong track. The disk store is a 
rotating logging based, mostly write-only store. Logging based as new 
content is written sequentially from start to end of the file, rotated 
because when the file is full it starts at byte 0 thereby overwriting 
old pages. It is mostly write-only as only when a user presses the back 
button data may be read back from the page store.

Early removal of data will only mean more disk-head movements making it 
slower instead of faster.

Regards,
    Erik.



David R Robison wrote:
> I have been monitoring the size of the pm-null file stored in the Work 
> directory from Tomcat. I assume that it is the serialized version of 
> the PageMap. I have an application where, if I navigate from page A to 
> page B and then back to page A, the pm-null file keeps growing. I 
> understand that I can set the maximum number of pages saved in the 
> PageMap but I am not sure what the default is set to. Also, if I am 
> leaving a page with a form and do not intend to return to that page 
> and submit its values, do I even need it in the PageMap? Is there a 
> way I can remove my page from the PageMap when I know I am no longer 
> going to need its values? My end goal is to try and squeeze more 
> performance out of my application. I hope this is understandable... 
> any thoughts?
>


-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Question on PageMap

Posted by David R Robison <dr...@openroadsconsulting.com>.
I have been monitoring the size of the pm-null file stored in the Work 
directory from Tomcat. I assume that it is the serialized version of the 
PageMap. I have an application where, if I navigate from page A to page 
B and then back to page A, the pm-null file keeps growing. I understand 
that I can set the maximum number of pages saved in the PageMap but I am 
not sure what the default is set to. Also, if I am leaving a page with a 
form and do not intend to return to that page and submit its values, do 
I even need it in the PageMap? Is there a way I can remove my page from 
the PageMap when I know I am no longer going to need its values? My end 
goal is to try and squeeze more performance out of my application. I 
hope this is understandable... any thoughts?

-- 

David R Robison
Open Roads Consulting, Inc.
103 Watson Road, Chesapeake, VA 23320
phone: (757) 546-3401
e-mail: drrobison@openroadsconsulting.com
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/book_detail.php?id=2579


 




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Size of session cache

Posted by Johan Compagner <jc...@gmail.com>.
See:

/**
     * Creates a new {@link DiskPageStore} instance.
     *
     * @param maxSizePerPagemap
     *            the maximum size of pagemap file (in bytes)
     * @param maxSizePerSession
     *            the maximum size of session (in bytes)
     * @param fileChannelPoolCapacity
     *            the maximum number of concurrently opened files (higher
number improves
     *            performance under heavy load).
     *
     */
    public DiskPageStore(int maxSizePerPagemap, int maxSizePerSession, int
fileChannelPoolCapacity)
    {
        this(getDefaultFileStoreFolder(), maxSizePerPagemap,
maxSizePerSession,
            fileChannelPoolCapacity);
    }


On Tue, Nov 11, 2008 at 2:37 PM, David R Robison <
drrobison@openroadsconsulting.com> wrote:

> The size the session takes up on the disk. David
>
>
> Johan Compagner wrote:
>
>> which size exactly are you talking about?
>>
>>
>> On Mon, Nov 10, 2008 at 11:03 PM, David R Robison <
>> drrobison@openroadsconsulting.com> wrote:
>>
>>
>>
>>> Is there a convenient way to tell the size of user's session cache? David
>>>
>>> --
>>>
>>> David R Robison
>>> Open Roads Consulting, Inc.
>>> 103 Watson Road, Chesapeake, VA 23320
>>> phone: (757) 546-3401
>>> e-mail: drrobison@openroadsconsulting.com
>>> web: http://openroadsconsulting.com
>>> blog: http://therobe.blogspot.com
>>> book: http://www.xulonpress.com/book_detail.php?id=2579
>>>
>>> This e-mail communication (including any attachments) may contain
>>> confidential and/or privileged material intended solely for the
>>> individual
>>> or entity to which it is addressed.  If you are not the intended
>>> recipient,
>>> you should immediately stop reading this message and delete it from all
>>> computers that it resides on. Any unauthorized reading, distribution,
>>> copying or other use of this communication (or its attachments) is
>>> strictly
>>> prohibited.  If you have received this communication in error, please
>>> notify
>>> us immediately.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>
>
> --
>
> David R Robison
> Open Roads Consulting, Inc.
> 103 Watson Road, Chesapeake, VA 23320
> phone: (757) 546-3401
> e-mail: drrobison@openroadsconsulting.com
> web: http://openroadsconsulting.com
> blog: http://therobe.blogspot.com
> book: http://www.xulonpress.com/book_detail.php?id=2579
>
> This e-mail communication (including any attachments) may contain
> confidential and/or privileged material intended solely for the individual
> or entity to which it is addressed.  If you are not the intended recipient,
> you should immediately stop reading this message and delete it from all
> computers that it resides on. Any unauthorized reading, distribution,
> copying or other use of this communication (or its attachments) is strictly
> prohibited.  If you have received this communication in error, please notify
> us immediately.
>
>
>
>
>

Re: Size of session cache

Posted by David R Robison <dr...@openroadsconsulting.com>.
The size the session takes up on the disk. David

Johan Compagner wrote:
> which size exactly are you talking about?
>
>
> On Mon, Nov 10, 2008 at 11:03 PM, David R Robison <
> drrobison@openroadsconsulting.com> wrote:
>
>   
>> Is there a convenient way to tell the size of user's session cache? David
>>
>> --
>>
>> David R Robison
>> Open Roads Consulting, Inc.
>> 103 Watson Road, Chesapeake, VA 23320
>> phone: (757) 546-3401
>> e-mail: drrobison@openroadsconsulting.com
>> web: http://openroadsconsulting.com
>> blog: http://therobe.blogspot.com
>> book: http://www.xulonpress.com/book_detail.php?id=2579
>>
>> This e-mail communication (including any attachments) may contain
>> confidential and/or privileged material intended solely for the individual
>> or entity to which it is addressed.  If you are not the intended recipient,
>> you should immediately stop reading this message and delete it from all
>> computers that it resides on. Any unauthorized reading, distribution,
>> copying or other use of this communication (or its attachments) is strictly
>> prohibited.  If you have received this communication in error, please notify
>> us immediately.
>>
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>     
>
>   

-- 

David R Robison
Open Roads Consulting, Inc.
103 Watson Road, Chesapeake, VA 23320
phone: (757) 546-3401
e-mail: drrobison@openroadsconsulting.com
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/book_detail.php?id=2579

This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed.  If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited.  If you have received this communication in error, please notify us immediately.  



 


Re: Size of session cache

Posted by Johan Compagner <jc...@gmail.com>.
which size exactly are you talking about?


On Mon, Nov 10, 2008 at 11:03 PM, David R Robison <
drrobison@openroadsconsulting.com> wrote:

> Is there a convenient way to tell the size of user's session cache? David
>
> --
>
> David R Robison
> Open Roads Consulting, Inc.
> 103 Watson Road, Chesapeake, VA 23320
> phone: (757) 546-3401
> e-mail: drrobison@openroadsconsulting.com
> web: http://openroadsconsulting.com
> blog: http://therobe.blogspot.com
> book: http://www.xulonpress.com/book_detail.php?id=2579
>
> This e-mail communication (including any attachments) may contain
> confidential and/or privileged material intended solely for the individual
> or entity to which it is addressed.  If you are not the intended recipient,
> you should immediately stop reading this message and delete it from all
> computers that it resides on. Any unauthorized reading, distribution,
> copying or other use of this communication (or its attachments) is strictly
> prohibited.  If you have received this communication in error, please notify
> us immediately.
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Size of session cache

Posted by David R Robison <dr...@openroadsconsulting.com>.
Is there a convenient way to tell the size of user's session cache? David

-- 

David R Robison
Open Roads Consulting, Inc.
103 Watson Road, Chesapeake, VA 23320
phone: (757) 546-3401
e-mail: drrobison@openroadsconsulting.com
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/book_detail.php?id=2579

This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed.  If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited.  If you have received this communication in error, please notify us immediately.  



 




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


PageLink or BookmarkablePageLink

Posted by David R Robison <dr...@openroadsconsulting.com>.
Is there any advantage to using PageLink over BookmarkablePageLink? David

-- 

David R Robison
Open Roads Consulting, Inc.
103 Watson Road, Chesapeake, VA 23320
phone: (757) 546-3401
e-mail: drrobison@openroadsconsulting.com
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/book_detail.php?id=2579


 




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: IDataProvider and Session related data.

Posted by James Carman <ja...@carmanconsulting.com>.
First of all, the userid probably isn't much information (a string,
I'd imagine), so it sounds like you may be prematurely optimizing.
Anyway, you can always get the current session by doing:

MySession sess = (MySession)Session.get();





On Mon, Nov 10, 2008 at 4:23 PM, Graeme Knight <gr...@gmail.com> wrote:
>
> Hi.
>
> Just learning about IDataProvider and DataViews.
>
> I've scoped out the repeaters examples but this may be a little different...
>
> If I have a userId (for example stored in the Session) of the user as he is
> logged in and I wish to use that userId as a criteria for getting hold of
> the correct data using a IDataProvider (for a DataView list), then should I
> pass in the userID to the IDataProvider implementation and just store as a
> private variable?
>
> Is there a better way of getting hold of (or passing this) information into
> the IDataProvider implementation to limit storage/serialization?
>
> Many thanks, Graeme.
> --
> View this message in context: http://www.nabble.com/IDataProvider-and-Session-related-data.-tp20428354p20428354.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org