Re: Increasing session size

2012-10-08 Thread Martijn Dashorst
http://docs.oracle.com/javaee/1.2.1/api/javax/servlet/http/HttpSession.html#setMaxInactiveInterval(int)

On Mon, Oct 8, 2012 at 12:46 PM, shruts shruts.inn...@gmail.com wrote:
 Hi

 is there any way that we can set the session time out only for a restricted
 number of page for which login is not required.



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/DataView-and-increasing-session-size-tp1876757p4652739.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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



Re: Increasing session size

2009-01-30 Thread Jürgen Lind

Probably I was a bit unclear, I was talking about the serialized session
on disk. Does the should not grow aspect apply there, too?

J.

Igor Vaynberg wrote:

considering wicket only keeps last-accessed page in session your
session shouldnt just keep growing...

-igor

On Thu, Jan 29, 2009 at 11:20 PM, Jürgen Lind juergen.l...@iteratec.de wrote:

One more thing: just as a rule of thumb, what would be a reasonable
amount of data that gets added to the session for a single request?
20k? 100k?

Regards,

J.



Michael Sparer wrote:

I took a cursory glance over your code and saw

 item.add(new Link(update, new Model(auftrag))

this way the auftrag gets into your session, you should say
item.getModel() there instead of new Model(auftrag)

check your code if there is similar stuff in it - spotting those things
might be quite tedious, but you could e.g. temporarily remove the
Serializable from your model-classes and go spotting nonserializable
exceptions until they don't ocurr anymore.
hope that helps a bit - and thanks for beating leverkusen in 2000 ;-)

regards,
Michael

Jürgen Lind-2 wrote:

After some twiddling I found that the PagingNavigator seems to be the
culprit.
If I leave it out, the session grows only moderately, when I put it in,
the
domain objects end up in the session... Anyway here is the code:

public class AuftragUebersicht extends MasterLayout {

  @SpringBean
  private AuftragBA auftragBA;

  public AuftragUebersicht() {
this.initComponents();
  }

  private void initComponents() {

final AuftragDataView auftragDataView = new
AuftragDataView(resultList,
new AuftragDataProvider(AuftragUebersicht.this.auftragBA), 10);

Form form = new Form(searchForm) {

  public Form initComponents() {
final TextField auftragsnummerField = new
TextField(auftragsnummer,
 new
Model());
add(auftragsnummerField);

Button searchButton = new Button(search) {
  public void onSubmit() {
String auftragsnummer =
auftragsnummerField.getModelObjectAsString();

AuftragDataProvider p = (AuftragDataProvider)
 auftragDataView.getDataProvider();
p.setQuery(new AuftragUebersichtQuery(auftragsnummer));

if (auftragDataView.getDataProvider().size() == 0) {
  AuftragUebersicht.this.info(No results found!);
}
  }
};
add(searchButton);

return this;
  }

}.initComponents();

WebMarkupContainer resultListContainer = new
WebMarkupContainer(resultListContainer) {
  public boolean isVisible() {
return auftragDataView.getDataProvider().size()  0;
  }
};

CheckGroup group = new CheckGroup(group, new
ArrayListPartnerAuftrag());

group.add(new CheckGroupSelector(groupselector));

group.add(auftragDataView);

resultListContainer.add(new PagingNavigator(navigator,
auftragDataView));

resultListContainer.add(group);

form.add(resultListContainer);

this.add(form);

  }
}

public class AuftragDataView extends DataView {

  public AuftragDataView(String id, IDataProvider dataProvider, int
itemsPerPage) {
super(id, dataProvider, itemsPerPage);
  }

  @Override
  protected void populateItem(final Item item) {

final PartnerAuftrag auftrag = (PartnerAuftrag)
item.getModelObject();
item.add(new Label(auftragsnummer, auftrag.getAuftragsnummer()));
...

item.add(new Link(update, new Model(auftrag)) {
  public void onClick() {
AuftragBearbeiten page = new AuftragBearbeiten((PartnerAuftrag)
getModelObject());
setResponsePage(page);
  }
});

item.add(new AttributeModifier(class, true, new
AbstractReadOnlyModel() {
  public Object getObject() {
return (item.getIndex() % 2 == 1) ? even : odd;
  }
}));
  }

  @Override
  protected void onDetach() {
super.onDetach();
  }
}

public class AuftragDataProvider implements IDataProvider {

  private AuftragBA  auftragBA;
  private AuftragUebersichtQuery query;

  private CollectionPartnerAuftrag result;

  public AuftragDataProvider(AuftragUebersichtQuery query, AuftragBA
auftragBA) {
this.query = query;
this.auftragBA = auftragBA;
  }

  public AuftragUebersichtQuery getQuery() {
return this.query;
  }

  public void setQuery(AuftragUebersichtQuery query) {
this.query = query;
this.result = null;
  }

  public IteratorPartnerAuftrag iterator(int first, int count) {
if (this.result == null) {
  this.performQuery();
}
return new ArrayListPartnerAuftrag(this.result).subList(first,
first + count).iterator();
  }

  public IModel model(final Object object) {
return new DetachablePartnerAuftragModel((PartnerAuftrag) object,
this.auftragBA);
  }

  public int size() {
if (this.result == null) {
  this.performQuery();
}
return this.result.size();
  }

  public 

Re: Increasing session size

2009-01-30 Thread Johan Compagner
yes it grows until a max

public DiskPageStore()
{
this((int)Bytes.megabytes(10).bytes(),
(int)Bytes.megabytes(100).bytes(), 50);
}

(10MB for one pagemap and 100MB for a complete session over multiply
pagemaps)

On Fri, Jan 30, 2009 at 09:44, Jürgen Lind juergen.l...@iteratec.de wrote:

 Probably I was a bit unclear, I was talking about the serialized session
 on disk. Does the should not grow aspect apply there, too?

 J.


 Igor Vaynberg wrote:

 considering wicket only keeps last-accessed page in session your
 session shouldnt just keep growing...

 -igor

 On Thu, Jan 29, 2009 at 11:20 PM, Jürgen Lind juergen.l...@iteratec.de
 wrote:

 One more thing: just as a rule of thumb, what would be a reasonable
 amount of data that gets added to the session for a single request?
 20k? 100k?

 Regards,

 J.



 Michael Sparer wrote:

 I took a cursory glance over your code and saw

  item.add(new Link(update, new Model(auftrag))

 this way the auftrag gets into your session, you should say
 item.getModel() there instead of new Model(auftrag)

 check your code if there is similar stuff in it - spotting those things
 might be quite tedious, but you could e.g. temporarily remove the
 Serializable from your model-classes and go spotting nonserializable
 exceptions until they don't ocurr anymore.
 hope that helps a bit - and thanks for beating leverkusen in 2000 ;-)

 regards,
 Michael

 Jürgen Lind-2 wrote:

 After some twiddling I found that the PagingNavigator seems to be the
 culprit.
 If I leave it out, the session grows only moderately, when I put it in,
 the
 domain objects end up in the session... Anyway here is the code:

 public class AuftragUebersicht extends MasterLayout {

  @SpringBean
  private AuftragBA auftragBA;

  public AuftragUebersicht() {
this.initComponents();
  }

  private void initComponents() {

final AuftragDataView auftragDataView = new
 AuftragDataView(resultList,
new AuftragDataProvider(AuftragUebersicht.this.auftragBA), 10);

Form form = new Form(searchForm) {

  public Form initComponents() {
final TextField auftragsnummerField = new
 TextField(auftragsnummer,
 new
 Model());
add(auftragsnummerField);

Button searchButton = new Button(search) {
  public void onSubmit() {
String auftragsnummer =
 auftragsnummerField.getModelObjectAsString();

AuftragDataProvider p = (AuftragDataProvider)
 auftragDataView.getDataProvider();
p.setQuery(new AuftragUebersichtQuery(auftragsnummer));

if (auftragDataView.getDataProvider().size() == 0) {
  AuftragUebersicht.this.info(No results found!);
}
  }
};
add(searchButton);

return this;
  }

}.initComponents();

WebMarkupContainer resultListContainer = new
 WebMarkupContainer(resultListContainer) {
  public boolean isVisible() {
return auftragDataView.getDataProvider().size()  0;
  }
};

CheckGroup group = new CheckGroup(group, new
 ArrayListPartnerAuftrag());

group.add(new CheckGroupSelector(groupselector));

group.add(auftragDataView);

resultListContainer.add(new PagingNavigator(navigator,
 auftragDataView));

resultListContainer.add(group);

form.add(resultListContainer);

this.add(form);

  }
 }

 public class AuftragDataView extends DataView {

  public AuftragDataView(String id, IDataProvider dataProvider, int
 itemsPerPage) {
super(id, dataProvider, itemsPerPage);
  }

  @Override
  protected void populateItem(final Item item) {

final PartnerAuftrag auftrag = (PartnerAuftrag)
 item.getModelObject();
item.add(new Label(auftragsnummer, auftrag.getAuftragsnummer()));
...

item.add(new Link(update, new Model(auftrag)) {
  public void onClick() {
AuftragBearbeiten page = new AuftragBearbeiten((PartnerAuftrag)
 getModelObject());
setResponsePage(page);
  }
});

item.add(new AttributeModifier(class, true, new
 AbstractReadOnlyModel() {
  public Object getObject() {
return (item.getIndex() % 2 == 1) ? even : odd;
  }
}));
  }

  @Override
  protected void onDetach() {
super.onDetach();
  }
 }

 public class AuftragDataProvider implements IDataProvider {

  private AuftragBA  auftragBA;
  private AuftragUebersichtQuery query;

  private CollectionPartnerAuftrag result;

  public AuftragDataProvider(AuftragUebersichtQuery query, AuftragBA
 auftragBA) {
this.query = query;
this.auftragBA = auftragBA;
  }

  public AuftragUebersichtQuery getQuery() {
return this.query;
  }

  public void setQuery(AuftragUebersichtQuery query) {
this.query = query;
this.result = null;
  }

  public IteratorPartnerAuftrag iterator(int first, int count) {
if (this.result == null) {
  this.performQuery();
}
return 

Re: Increasing session size

2009-01-30 Thread Jürgen Lind

Thank you for pointing me to the means to tune the DiskPagestore size.
The only question that remains is whether it is normal that it keeps growing
and by what extend.

J.


Johan Compagner wrote:

yes it grows until a max

public DiskPageStore()
{
this((int)Bytes.megabytes(10).bytes(),
(int)Bytes.megabytes(100).bytes(), 50);
}

(10MB for one pagemap and 100MB for a complete session over multiply
pagemaps)

On Fri, Jan 30, 2009 at 09:44, Jürgen Lind juergen.l...@iteratec.de wrote:


Probably I was a bit unclear, I was talking about the serialized session
on disk. Does the should not grow aspect apply there, too?

J.


Igor Vaynberg wrote:


considering wicket only keeps last-accessed page in session your
session shouldnt just keep growing...

-igor

On Thu, Jan 29, 2009 at 11:20 PM, Jürgen Lind juergen.l...@iteratec.de
wrote:


One more thing: just as a rule of thumb, what would be a reasonable
amount of data that gets added to the session for a single request?
20k? 100k?

Regards,

J.



Michael Sparer wrote:


I took a cursory glance over your code and saw

 item.add(new Link(update, new Model(auftrag))

this way the auftrag gets into your session, you should say
item.getModel() there instead of new Model(auftrag)

check your code if there is similar stuff in it - spotting those things
might be quite tedious, but you could e.g. temporarily remove the
Serializable from your model-classes and go spotting nonserializable
exceptions until they don't ocurr anymore.
hope that helps a bit - and thanks for beating leverkusen in 2000 ;-)

regards,
Michael

Jürgen Lind-2 wrote:


After some twiddling I found that the PagingNavigator seems to be the
culprit.
If I leave it out, the session grows only moderately, when I put it in,
the
domain objects end up in the session... Anyway here is the code:

public class AuftragUebersicht extends MasterLayout {

 @SpringBean
 private AuftragBA auftragBA;

 public AuftragUebersicht() {
   this.initComponents();
 }

 private void initComponents() {

   final AuftragDataView auftragDataView = new
AuftragDataView(resultList,
   new AuftragDataProvider(AuftragUebersicht.this.auftragBA), 10);

   Form form = new Form(searchForm) {

 public Form initComponents() {
   final TextField auftragsnummerField = new
TextField(auftragsnummer,
new
Model());
   add(auftragsnummerField);

   Button searchButton = new Button(search) {
 public void onSubmit() {
   String auftragsnummer =
auftragsnummerField.getModelObjectAsString();

   AuftragDataProvider p = (AuftragDataProvider)
auftragDataView.getDataProvider();
   p.setQuery(new AuftragUebersichtQuery(auftragsnummer));

   if (auftragDataView.getDataProvider().size() == 0) {
 AuftragUebersicht.this.info(No results found!);
   }
 }
   };
   add(searchButton);

   return this;
 }

   }.initComponents();

   WebMarkupContainer resultListContainer = new
WebMarkupContainer(resultListContainer) {
 public boolean isVisible() {
   return auftragDataView.getDataProvider().size()  0;
 }
   };

   CheckGroup group = new CheckGroup(group, new
ArrayListPartnerAuftrag());

   group.add(new CheckGroupSelector(groupselector));

   group.add(auftragDataView);

   resultListContainer.add(new PagingNavigator(navigator,
auftragDataView));

   resultListContainer.add(group);

   form.add(resultListContainer);

   this.add(form);

 }
}

public class AuftragDataView extends DataView {

 public AuftragDataView(String id, IDataProvider dataProvider, int
itemsPerPage) {
   super(id, dataProvider, itemsPerPage);
 }

 @Override
 protected void populateItem(final Item item) {

   final PartnerAuftrag auftrag = (PartnerAuftrag)
item.getModelObject();
   item.add(new Label(auftragsnummer, auftrag.getAuftragsnummer()));
   ...

   item.add(new Link(update, new Model(auftrag)) {
 public void onClick() {
   AuftragBearbeiten page = new AuftragBearbeiten((PartnerAuftrag)
getModelObject());
   setResponsePage(page);
 }
   });

   item.add(new AttributeModifier(class, true, new
AbstractReadOnlyModel() {
 public Object getObject() {
   return (item.getIndex() % 2 == 1) ? even : odd;
 }
   }));
 }

 @Override
 protected void onDetach() {
   super.onDetach();
 }
}

public class AuftragDataProvider implements IDataProvider {

 private AuftragBA  auftragBA;
 private AuftragUebersichtQuery query;

 private CollectionPartnerAuftrag result;

 public AuftragDataProvider(AuftragUebersichtQuery query, AuftragBA
auftragBA) {
   this.query = query;
   this.auftragBA = auftragBA;
 }

 public AuftragUebersichtQuery getQuery() {
   return this.query;
 }

 public void setQuery(AuftragUebersichtQuery query) {
   this.query = query;
   this.result = null;
 }

 public IteratorPartnerAuftrag iterator(int first, int count) {
  

Re: Increasing session size

2009-01-30 Thread Johan Compagner
yes until the default 10MB i already said that.

On Fri, Jan 30, 2009 at 09:58, Jürgen Lind juergen.l...@iteratec.de wrote:

 Thank you for pointing me to the means to tune the DiskPagestore size.
 The only question that remains is whether it is normal that it keeps
 growing
 and by what extend.

 J.



 Johan Compagner wrote:

 yes it grows until a max

 public DiskPageStore()
{
this((int)Bytes.megabytes(10).bytes(),
 (int)Bytes.megabytes(100).bytes(), 50);
}

 (10MB for one pagemap and 100MB for a complete session over multiply
 pagemaps)

 On Fri, Jan 30, 2009 at 09:44, Jürgen Lind juergen.l...@iteratec.de
 wrote:

  Probably I was a bit unclear, I was talking about the serialized session
 on disk. Does the should not grow aspect apply there, too?

 J.


 Igor Vaynberg wrote:

  considering wicket only keeps last-accessed page in session your
 session shouldnt just keep growing...

 -igor

 On Thu, Jan 29, 2009 at 11:20 PM, Jürgen Lind juergen.l...@iteratec.de
 
 wrote:

  One more thing: just as a rule of thumb, what would be a reasonable
 amount of data that gets added to the session for a single request?
 20k? 100k?

 Regards,

 J.



 Michael Sparer wrote:

  I took a cursory glance over your code and saw

  item.add(new Link(update, new Model(auftrag))

 this way the auftrag gets into your session, you should say
 item.getModel() there instead of new Model(auftrag)

 check your code if there is similar stuff in it - spotting those
 things
 might be quite tedious, but you could e.g. temporarily remove the
 Serializable from your model-classes and go spotting nonserializable
 exceptions until they don't ocurr anymore.
 hope that helps a bit - and thanks for beating leverkusen in 2000 ;-)

 regards,
 Michael

 Jürgen Lind-2 wrote:

  After some twiddling I found that the PagingNavigator seems to be the
 culprit.
 If I leave it out, the session grows only moderately, when I put it
 in,
 the
 domain objects end up in the session... Anyway here is the code:

 public class AuftragUebersicht extends MasterLayout {

  @SpringBean
  private AuftragBA auftragBA;

  public AuftragUebersicht() {
   this.initComponents();
  }

  private void initComponents() {

   final AuftragDataView auftragDataView = new
 AuftragDataView(resultList,
   new AuftragDataProvider(AuftragUebersicht.this.auftragBA), 10);

   Form form = new Form(searchForm) {

 public Form initComponents() {
   final TextField auftragsnummerField = new
 TextField(auftragsnummer,
new
 Model());
   add(auftragsnummerField);

   Button searchButton = new Button(search) {
 public void onSubmit() {
   String auftragsnummer =
 auftragsnummerField.getModelObjectAsString();

   AuftragDataProvider p = (AuftragDataProvider)
auftragDataView.getDataProvider();
   p.setQuery(new AuftragUebersichtQuery(auftragsnummer));

   if (auftragDataView.getDataProvider().size() == 0) {
 AuftragUebersicht.this.info(No results found!);
   }
 }
   };
   add(searchButton);

   return this;
 }

   }.initComponents();

   WebMarkupContainer resultListContainer = new
 WebMarkupContainer(resultListContainer) {
 public boolean isVisible() {
   return auftragDataView.getDataProvider().size()  0;
 }
   };

   CheckGroup group = new CheckGroup(group, new
 ArrayListPartnerAuftrag());

   group.add(new CheckGroupSelector(groupselector));

   group.add(auftragDataView);

   resultListContainer.add(new PagingNavigator(navigator,
 auftragDataView));

   resultListContainer.add(group);

   form.add(resultListContainer);

   this.add(form);

  }
 }

 public class AuftragDataView extends DataView {

  public AuftragDataView(String id, IDataProvider dataProvider, int
 itemsPerPage) {
   super(id, dataProvider, itemsPerPage);
  }

  @Override
  protected void populateItem(final Item item) {

   final PartnerAuftrag auftrag = (PartnerAuftrag)
 item.getModelObject();
   item.add(new Label(auftragsnummer, auftrag.getAuftragsnummer()));
   ...

   item.add(new Link(update, new Model(auftrag)) {
 public void onClick() {
   AuftragBearbeiten page = new AuftragBearbeiten((PartnerAuftrag)
 getModelObject());
   setResponsePage(page);
 }
   });

   item.add(new AttributeModifier(class, true, new
 AbstractReadOnlyModel() {
 public Object getObject() {
   return (item.getIndex() % 2 == 1) ? even : odd;
 }
   }));
  }

  @Override
  protected void onDetach() {
   super.onDetach();
  }
 }

 public class AuftragDataProvider implements IDataProvider {

  private AuftragBA  auftragBA;
  private AuftragUebersichtQuery query;

  private CollectionPartnerAuftrag result;

  public AuftragDataProvider(AuftragUebersichtQuery query, AuftragBA
 auftragBA) {
   this.query = query;
   this.auftragBA = auftragBA;
  }

  public 

Re: Increasing session size

2009-01-30 Thread Jürgen Lind

Thank you for clarifying. The reason for for me asking these questions
is that it will be asked the very same questions once I recommend using
Wicket for the re-implementation of an existing application. I just want
to make sure that I have the correct answers :-)

J.

Johan Compagner wrote:

yes until the default 10MB i already said that.

On Fri, Jan 30, 2009 at 09:58, Jürgen Lind juergen.l...@iteratec.de wrote:


Thank you for pointing me to the means to tune the DiskPagestore size.
The only question that remains is whether it is normal that it keeps
growing
and by what extend.

J.



Johan Compagner wrote:


yes it grows until a max

public DiskPageStore()
   {
   this((int)Bytes.megabytes(10).bytes(),
(int)Bytes.megabytes(100).bytes(), 50);
   }

(10MB for one pagemap and 100MB for a complete session over multiply
pagemaps)

On Fri, Jan 30, 2009 at 09:44, Jürgen Lind juergen.l...@iteratec.de
wrote:

 Probably I was a bit unclear, I was talking about the serialized session

on disk. Does the should not grow aspect apply there, too?

J.


Igor Vaynberg wrote:

 considering wicket only keeps last-accessed page in session your

session shouldnt just keep growing...

-igor

On Thu, Jan 29, 2009 at 11:20 PM, Jürgen Lind juergen.l...@iteratec.de
wrote:

 One more thing: just as a rule of thumb, what would be a reasonable

amount of data that gets added to the session for a single request?
20k? 100k?

Regards,

J.



Michael Sparer wrote:

 I took a cursory glance over your code and saw

 item.add(new Link(update, new Model(auftrag))

this way the auftrag gets into your session, you should say
item.getModel() there instead of new Model(auftrag)

check your code if there is similar stuff in it - spotting those
things
might be quite tedious, but you could e.g. temporarily remove the
Serializable from your model-classes and go spotting nonserializable
exceptions until they don't ocurr anymore.
hope that helps a bit - and thanks for beating leverkusen in 2000 ;-)

regards,
Michael

Jürgen Lind-2 wrote:

 After some twiddling I found that the PagingNavigator seems to be the

culprit.
If I leave it out, the session grows only moderately, when I put it
in,
the
domain objects end up in the session... Anyway here is the code:

public class AuftragUebersicht extends MasterLayout {

 @SpringBean
 private AuftragBA auftragBA;

 public AuftragUebersicht() {
  this.initComponents();
 }

 private void initComponents() {

  final AuftragDataView auftragDataView = new
AuftragDataView(resultList,
  new AuftragDataProvider(AuftragUebersicht.this.auftragBA), 10);

  Form form = new Form(searchForm) {

public Form initComponents() {
  final TextField auftragsnummerField = new
TextField(auftragsnummer,
   new
Model());
  add(auftragsnummerField);

  Button searchButton = new Button(search) {
public void onSubmit() {
  String auftragsnummer =
auftragsnummerField.getModelObjectAsString();

  AuftragDataProvider p = (AuftragDataProvider)
   auftragDataView.getDataProvider();
  p.setQuery(new AuftragUebersichtQuery(auftragsnummer));

  if (auftragDataView.getDataProvider().size() == 0) {
AuftragUebersicht.this.info(No results found!);
  }
}
  };
  add(searchButton);

  return this;
}

  }.initComponents();

  WebMarkupContainer resultListContainer = new
WebMarkupContainer(resultListContainer) {
public boolean isVisible() {
  return auftragDataView.getDataProvider().size()  0;
}
  };

  CheckGroup group = new CheckGroup(group, new
ArrayListPartnerAuftrag());

  group.add(new CheckGroupSelector(groupselector));

  group.add(auftragDataView);

  resultListContainer.add(new PagingNavigator(navigator,
auftragDataView));

  resultListContainer.add(group);

  form.add(resultListContainer);

  this.add(form);

 }
}

public class AuftragDataView extends DataView {

 public AuftragDataView(String id, IDataProvider dataProvider, int
itemsPerPage) {
  super(id, dataProvider, itemsPerPage);
 }

 @Override
 protected void populateItem(final Item item) {

  final PartnerAuftrag auftrag = (PartnerAuftrag)
item.getModelObject();
  item.add(new Label(auftragsnummer, auftrag.getAuftragsnummer()));
  ...

  item.add(new Link(update, new Model(auftrag)) {
public void onClick() {
  AuftragBearbeiten page = new AuftragBearbeiten((PartnerAuftrag)
getModelObject());
  setResponsePage(page);
}
  });

  item.add(new AttributeModifier(class, true, new
AbstractReadOnlyModel() {
public Object getObject() {
  return (item.getIndex() % 2 == 1) ? even : odd;
}
  }));
 }

 @Override
 protected void onDetach() {
  super.onDetach();
 }
}

public class AuftragDataProvider implements IDataProvider {

 private AuftragBA  auftragBA;
 private AuftragUebersichtQuery query;

 private CollectionPartnerAuftrag result;

 

DataView and increasing session size

2009-01-29 Thread Jürgen Lind

Hi,

I have a question on how the DataView component is supposed to work. In my
application, I have to show quite large list of entities and so I am using
a DataView together with LoadableDetachableModels to read the data on demand.
However, when looking at the serialized sessions, I can observe that the
session size constantly increases by a fairly large amount although I am
just using the navigator to page through the list. Also, when looking into
the serialized session, I can see that the objects that are supposed to
be reloaded on demand are serialized into the session as well.

Is this the behavior that I would expect from the DataView or am I making
some mistake here?

Regards,

J.

--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel


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



Re: DataView and increasing session size

2009-01-29 Thread Michael Sparer

the objects shouldn't be serialized into the session if you're using
loadabledetachable models, please show us some code

regards,
Michael


Jürgen Lind-2 wrote:
 
 Hi,
 
 I have a question on how the DataView component is supposed to work. In my
 application, I have to show quite large list of entities and so I am using
 a DataView together with LoadableDetachableModels to read the data on
 demand.
 However, when looking at the serialized sessions, I can observe that the
 session size constantly increases by a fairly large amount although I am
 just using the navigator to page through the list. Also, when looking into
 the serialized session, I can see that the objects that are supposed to
 be reloaded on demand are serialized into the session as well.
 
 Is this the behavior that I would expect from the DataView or am I making
 some mistake here?
 
 Regards,
 
 J.
 
 --
 Dr. Jürgen Lind
 iteratec GmbHFon: +49 (0)89 614551-44
 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
 82008 Unterhaching   Web: www.iteratec.de
 
 Sitz und Registergericht der iteratec GmbH: München HRB 113 519
 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/DataView-and-increasing-session-size-tp21723557p21724558.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: DataView and increasing session size

2009-01-29 Thread Jürgen Lind

After some twiddling I found that the PagingNavigator seems to be the culprit.
If I leave it out, the session grows only moderately, when I put it in, the
domain objects end up in the session... Anyway here is the code:

public class AuftragUebersicht extends MasterLayout {

  @SpringBean
  private AuftragBA auftragBA;

  public AuftragUebersicht() {
this.initComponents();
  }

  private void initComponents() {

final AuftragDataView auftragDataView = new AuftragDataView(resultList,
new AuftragDataProvider(AuftragUebersicht.this.auftragBA), 10);

Form form = new Form(searchForm) {

  public Form initComponents() {
final TextField auftragsnummerField = new TextField(auftragsnummer,
 new Model());
add(auftragsnummerField);

Button searchButton = new Button(search) {
  public void onSubmit() {
String auftragsnummer = 
auftragsnummerField.getModelObjectAsString();

AuftragDataProvider p = (AuftragDataProvider)
 auftragDataView.getDataProvider();
p.setQuery(new AuftragUebersichtQuery(auftragsnummer));

if (auftragDataView.getDataProvider().size() == 0) {
  AuftragUebersicht.this.info(No results found!);
}
  }
};
add(searchButton);

return this;
  }

}.initComponents();

WebMarkupContainer resultListContainer = new 
WebMarkupContainer(resultListContainer) {
  public boolean isVisible() {
return auftragDataView.getDataProvider().size()  0;
  }
};

CheckGroup group = new CheckGroup(group, new ArrayListPartnerAuftrag());

group.add(new CheckGroupSelector(groupselector));

group.add(auftragDataView);

resultListContainer.add(new PagingNavigator(navigator, auftragDataView));

resultListContainer.add(group);

form.add(resultListContainer);

this.add(form);

  }
}

public class AuftragDataView extends DataView {

  public AuftragDataView(String id, IDataProvider dataProvider, int 
itemsPerPage) {
super(id, dataProvider, itemsPerPage);
  }

  @Override
  protected void populateItem(final Item item) {

final PartnerAuftrag auftrag = (PartnerAuftrag) item.getModelObject();
item.add(new Label(auftragsnummer, auftrag.getAuftragsnummer()));
...

item.add(new Link(update, new Model(auftrag)) {
  public void onClick() {
AuftragBearbeiten page = new AuftragBearbeiten((PartnerAuftrag) 
getModelObject());
setResponsePage(page);
  }
});

item.add(new AttributeModifier(class, true, new AbstractReadOnlyModel() {
  public Object getObject() {
return (item.getIndex() % 2 == 1) ? even : odd;
  }
}));
  }

  @Override
  protected void onDetach() {
super.onDetach();
  }
}

public class AuftragDataProvider implements IDataProvider {

  private AuftragBA  auftragBA;
  private AuftragUebersichtQuery query;

  private CollectionPartnerAuftrag result;

  public AuftragDataProvider(AuftragUebersichtQuery query, AuftragBA auftragBA) 
{
this.query = query;
this.auftragBA = auftragBA;
  }

  public AuftragUebersichtQuery getQuery() {
return this.query;
  }

  public void setQuery(AuftragUebersichtQuery query) {
this.query = query;
this.result = null;
  }

  public IteratorPartnerAuftrag iterator(int first, int count) {
if (this.result == null) {
  this.performQuery();
}
return new ArrayListPartnerAuftrag(this.result).subList(first, first + 
count).iterator();
  }

  public IModel model(final Object object) {
return new DetachablePartnerAuftragModel((PartnerAuftrag) object, 
this.auftragBA);
  }

  public int size() {
if (this.result == null) {
  this.performQuery();
}
return this.result.size();
  }

  public void detach() {
this.result = null;
  }

  private void performQuery() {
...
  }
}


public class DetachablePartnerAuftragModel extends LoadableDetachableModel {

  private Long  id;
  private AuftragBA auftragBA;

  public DetachablePartnerAuftragModel(PartnerAuftrag auftrag, AuftragBA 
auftragBA) {
this(auftrag.getAuftragsId(), auftragBA);
  }

  public DetachablePartnerAuftragModel(Long id, AuftragBA auftragBA) {
this.id = id;
this.auftragBA = auftragBA;
  }

  @Override
  protected Object load() {
return this.auftragBA.findAuftragByAuftragsId(this.id);
  }

  @Override
  protected void onDetach() {
super.onDetach();
  }
}

Michael Sparer wrote:
 the objects shouldn't be serialized into the session if you're using
 loadabledetachable models, please show us some code

 regards,
 Michael


 Jürgen Lind-2 wrote:
 Hi,

 I have a question on how the DataView component is supposed to work. In my
 application, I have to show quite large list of entities and so I am using
 a DataView together with LoadableDetachableModels to read the data on
 demand.
 

Re: DataView and increasing session size

2009-01-29 Thread Michael Sparer
 DetachablePartnerAuftragModel(PartnerAuftrag auftrag, AuftragBA
 auftragBA) {
  this(auftrag.getAuftragsId(), auftragBA);
}
 
public DetachablePartnerAuftragModel(Long id, AuftragBA auftragBA) {
  this.id = id;
  this.auftragBA = auftragBA;
}
 
@Override
protected Object load() {
  return this.auftragBA.findAuftragByAuftragsId(this.id);
}
 
@Override
protected void onDetach() {
  super.onDetach();
}
 }
 
 Michael Sparer wrote:
   the objects shouldn't be serialized into the session if you're using
   loadabledetachable models, please show us some code
  
   regards,
   Michael
  
  
   Jürgen Lind-2 wrote:
   Hi,
  
   I have a question on how the DataView component is supposed to work.
 In my
   application, I have to show quite large list of entities and so I am
 using
   a DataView together with LoadableDetachableModels to read the data on
   demand.
   However, when looking at the serialized sessions, I can observe that
 the
   session size constantly increases by a fairly large amount although I
 am
   just using the navigator to page through the list. Also, when looking
 into
   the serialized session, I can see that the objects that are supposed
 to
   be reloaded on demand are serialized into the session as well.
  
   Is this the behavior that I would expect from the DataView or am I
 making
   some mistake here?
  
   Regards,
  
   J.
  
   --
   Dr. Jürgen Lind
   iteratec GmbHFon: +49 (0)89 614551-44
   Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
   82008 Unterhaching   Web: www.iteratec.de
  
   Sitz und Registergericht der iteratec GmbH: München HRB 113 519
   Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf
 Menzel
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
  
  
   -
   Michael Sparer
   http://talk-on-tech.blogspot.com
 
 -- 
 Mit freundlichen Grüßen,
 
 Jürgen Lind
 
 --
 Dr. Jürgen Lind
 iteratec GmbHFon: +49 (0)89 614551-44
 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
 82008 Unterhaching   Web: www.iteratec.de
 
 Sitz und Registergericht der iteratec GmbH: München HRB 113 519
 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/DataView-and-increasing-session-size-tp21723557p21725913.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: DataView and increasing session size

2009-01-29 Thread Jürgen Lind

Michael,

thanks for your help, it significantly reduced the amount of session data.
Still, the session keeps growing... Is there any way to determine which
objects get serialized and where they are dangling? Removing the Serializable
interface helps me to spot my own classes but it does not work on classes
not under my control.

Regards,

J.

PS:
 hope that helps a bit - and thanks for beating leverkusen in 2000 ;-)

My pleasure, however, I only came to Munich/Unterhaching in 2000 so it is not
really to my credit. Still, as a long time FCK Fan, I love to see Leverkusen
loosing after sending us down a League in 1996...


Michael Sparer wrote:

I took a cursory glance over your code and saw

 item.add(new Link(update, new Model(auftrag))

this way the auftrag gets into your session, you should say
item.getModel() there instead of new Model(auftrag)

check your code if there is similar stuff in it - spotting those things
might be quite tedious, but you could e.g. temporarily remove the
Serializable from your model-classes and go spotting nonserializable
exceptions until they don't ocurr anymore. 


hope that helps a bit - and thanks for beating leverkusen in 2000 ;-)

regards,
Michael 



Jürgen Lind-2 wrote:

After some twiddling I found that the PagingNavigator seems to be the
culprit.
If I leave it out, the session grows only moderately, when I put it in,
the
domain objects end up in the session... Anyway here is the code:

public class AuftragUebersicht extends MasterLayout {

   @SpringBean
   private AuftragBA auftragBA;

   public AuftragUebersicht() {
 this.initComponents();
   }

   private void initComponents() {

 final AuftragDataView auftragDataView = new
AuftragDataView(resultList,
 new AuftragDataProvider(AuftragUebersicht.this.auftragBA), 10);

 Form form = new Form(searchForm) {

   public Form initComponents() {
 final TextField auftragsnummerField = new
TextField(auftragsnummer,
  new
Model());
 add(auftragsnummerField);

 Button searchButton = new Button(search) {
   public void onSubmit() {
 String auftragsnummer =
auftragsnummerField.getModelObjectAsString();

 AuftragDataProvider p = (AuftragDataProvider)
  auftragDataView.getDataProvider();
 p.setQuery(new AuftragUebersichtQuery(auftragsnummer));

 if (auftragDataView.getDataProvider().size() == 0) {
   AuftragUebersicht.this.info(No results found!);
 }
   }
 };
 add(searchButton);

 return this;
   }

 }.initComponents();

 WebMarkupContainer resultListContainer = new
WebMarkupContainer(resultListContainer) {
   public boolean isVisible() {
 return auftragDataView.getDataProvider().size()  0;
   }
 };

 CheckGroup group = new CheckGroup(group, new
ArrayListPartnerAuftrag());

 group.add(new CheckGroupSelector(groupselector));

 group.add(auftragDataView);

 resultListContainer.add(new PagingNavigator(navigator,
auftragDataView));

 resultListContainer.add(group);

 form.add(resultListContainer);

 this.add(form);

   }
}

public class AuftragDataView extends DataView {

   public AuftragDataView(String id, IDataProvider dataProvider, int
itemsPerPage) {
 super(id, dataProvider, itemsPerPage);
   }

   @Override
   protected void populateItem(final Item item) {

 final PartnerAuftrag auftrag = (PartnerAuftrag)
item.getModelObject();
 item.add(new Label(auftragsnummer, auftrag.getAuftragsnummer()));
 ...

 item.add(new Link(update, new Model(auftrag)) {
   public void onClick() {
 AuftragBearbeiten page = new AuftragBearbeiten((PartnerAuftrag)
getModelObject());
 setResponsePage(page);
   }
 });

 item.add(new AttributeModifier(class, true, new
AbstractReadOnlyModel() {
   public Object getObject() {
 return (item.getIndex() % 2 == 1) ? even : odd;
   }
 }));
   }

   @Override
   protected void onDetach() {
 super.onDetach();
   }
}

public class AuftragDataProvider implements IDataProvider {

   private AuftragBA  auftragBA;
   private AuftragUebersichtQuery query;

   private CollectionPartnerAuftrag result;

   public AuftragDataProvider(AuftragUebersichtQuery query, AuftragBA
auftragBA) {
 this.query = query;
 this.auftragBA = auftragBA;
   }

   public AuftragUebersichtQuery getQuery() {
 return this.query;
   }

   public void setQuery(AuftragUebersichtQuery query) {
 this.query = query;
 this.result = null;
   }

   public IteratorPartnerAuftrag iterator(int first, int count) {
 if (this.result == null) {
   this.performQuery();
 }
 return new ArrayListPartnerAuftrag(this.result).subList(first,
first + count).iterator();
   }

   public IModel model(final Object object) {
 return 

Increasing session size

2009-01-29 Thread Jürgen Lind

One more thing: just as a rule of thumb, what would be a reasonable
amount of data that gets added to the session for a single request?
20k? 100k?

Regards,

J.



Michael Sparer wrote:

I took a cursory glance over your code and saw

 item.add(new Link(update, new Model(auftrag))

this way the auftrag gets into your session, you should say
item.getModel() there instead of new Model(auftrag)

check your code if there is similar stuff in it - spotting those things
might be quite tedious, but you could e.g. temporarily remove the
Serializable from your model-classes and go spotting nonserializable
exceptions until they don't ocurr anymore. 


hope that helps a bit - and thanks for beating leverkusen in 2000 ;-)

regards,
Michael 



Jürgen Lind-2 wrote:

After some twiddling I found that the PagingNavigator seems to be the
culprit.
If I leave it out, the session grows only moderately, when I put it in,
the
domain objects end up in the session... Anyway here is the code:

public class AuftragUebersicht extends MasterLayout {

   @SpringBean
   private AuftragBA auftragBA;

   public AuftragUebersicht() {
 this.initComponents();
   }

   private void initComponents() {

 final AuftragDataView auftragDataView = new
AuftragDataView(resultList,
 new AuftragDataProvider(AuftragUebersicht.this.auftragBA), 10);

 Form form = new Form(searchForm) {

   public Form initComponents() {
 final TextField auftragsnummerField = new
TextField(auftragsnummer,
  new
Model());
 add(auftragsnummerField);

 Button searchButton = new Button(search) {
   public void onSubmit() {
 String auftragsnummer =
auftragsnummerField.getModelObjectAsString();

 AuftragDataProvider p = (AuftragDataProvider)
  auftragDataView.getDataProvider();
 p.setQuery(new AuftragUebersichtQuery(auftragsnummer));

 if (auftragDataView.getDataProvider().size() == 0) {
   AuftragUebersicht.this.info(No results found!);
 }
   }
 };
 add(searchButton);

 return this;
   }

 }.initComponents();

 WebMarkupContainer resultListContainer = new
WebMarkupContainer(resultListContainer) {
   public boolean isVisible() {
 return auftragDataView.getDataProvider().size()  0;
   }
 };

 CheckGroup group = new CheckGroup(group, new
ArrayListPartnerAuftrag());

 group.add(new CheckGroupSelector(groupselector));

 group.add(auftragDataView);

 resultListContainer.add(new PagingNavigator(navigator,
auftragDataView));

 resultListContainer.add(group);

 form.add(resultListContainer);

 this.add(form);

   }
}

public class AuftragDataView extends DataView {

   public AuftragDataView(String id, IDataProvider dataProvider, int
itemsPerPage) {
 super(id, dataProvider, itemsPerPage);
   }

   @Override
   protected void populateItem(final Item item) {

 final PartnerAuftrag auftrag = (PartnerAuftrag)
item.getModelObject();
 item.add(new Label(auftragsnummer, auftrag.getAuftragsnummer()));
 ...

 item.add(new Link(update, new Model(auftrag)) {
   public void onClick() {
 AuftragBearbeiten page = new AuftragBearbeiten((PartnerAuftrag)
getModelObject());
 setResponsePage(page);
   }
 });

 item.add(new AttributeModifier(class, true, new
AbstractReadOnlyModel() {
   public Object getObject() {
 return (item.getIndex() % 2 == 1) ? even : odd;
   }
 }));
   }

   @Override
   protected void onDetach() {
 super.onDetach();
   }
}

public class AuftragDataProvider implements IDataProvider {

   private AuftragBA  auftragBA;
   private AuftragUebersichtQuery query;

   private CollectionPartnerAuftrag result;

   public AuftragDataProvider(AuftragUebersichtQuery query, AuftragBA
auftragBA) {
 this.query = query;
 this.auftragBA = auftragBA;
   }

   public AuftragUebersichtQuery getQuery() {
 return this.query;
   }

   public void setQuery(AuftragUebersichtQuery query) {
 this.query = query;
 this.result = null;
   }

   public IteratorPartnerAuftrag iterator(int first, int count) {
 if (this.result == null) {
   this.performQuery();
 }
 return new ArrayListPartnerAuftrag(this.result).subList(first,
first + count).iterator();
   }

   public IModel model(final Object object) {
 return new DetachablePartnerAuftragModel((PartnerAuftrag) object,
this.auftragBA);
   }

   public int size() {
 if (this.result == null) {
   this.performQuery();
 }
 return this.result.size();
   }

   public void detach() {
 this.result = null;
   }

   private void performQuery() {
 ...
   }
}


public class DetachablePartnerAuftragModel extends LoadableDetachableModel
{

   private Long  id;
   private AuftragBA auftragBA;

   public 

Re: Increasing session size

2009-01-29 Thread Igor Vaynberg
considering wicket only keeps last-accessed page in session your
session shouldnt just keep growing...

-igor

On Thu, Jan 29, 2009 at 11:20 PM, Jürgen Lind juergen.l...@iteratec.de wrote:
 One more thing: just as a rule of thumb, what would be a reasonable
 amount of data that gets added to the session for a single request?
 20k? 100k?

 Regards,

 J.



 Michael Sparer wrote:

 I took a cursory glance over your code and saw

  item.add(new Link(update, new Model(auftrag))

 this way the auftrag gets into your session, you should say
 item.getModel() there instead of new Model(auftrag)

 check your code if there is similar stuff in it - spotting those things
 might be quite tedious, but you could e.g. temporarily remove the
 Serializable from your model-classes and go spotting nonserializable
 exceptions until they don't ocurr anymore.
 hope that helps a bit - and thanks for beating leverkusen in 2000 ;-)

 regards,
 Michael

 Jürgen Lind-2 wrote:

 After some twiddling I found that the PagingNavigator seems to be the
 culprit.
 If I leave it out, the session grows only moderately, when I put it in,
 the
 domain objects end up in the session... Anyway here is the code:

 public class AuftragUebersicht extends MasterLayout {

   @SpringBean
   private AuftragBA auftragBA;

   public AuftragUebersicht() {
 this.initComponents();
   }

   private void initComponents() {

 final AuftragDataView auftragDataView = new
 AuftragDataView(resultList,
 new AuftragDataProvider(AuftragUebersicht.this.auftragBA), 10);

 Form form = new Form(searchForm) {

   public Form initComponents() {
 final TextField auftragsnummerField = new
 TextField(auftragsnummer,
  new
 Model());
 add(auftragsnummerField);

 Button searchButton = new Button(search) {
   public void onSubmit() {
 String auftragsnummer =
 auftragsnummerField.getModelObjectAsString();

 AuftragDataProvider p = (AuftragDataProvider)
  auftragDataView.getDataProvider();
 p.setQuery(new AuftragUebersichtQuery(auftragsnummer));

 if (auftragDataView.getDataProvider().size() == 0) {
   AuftragUebersicht.this.info(No results found!);
 }
   }
 };
 add(searchButton);

 return this;
   }

 }.initComponents();

 WebMarkupContainer resultListContainer = new
 WebMarkupContainer(resultListContainer) {
   public boolean isVisible() {
 return auftragDataView.getDataProvider().size()  0;
   }
 };

 CheckGroup group = new CheckGroup(group, new
 ArrayListPartnerAuftrag());

 group.add(new CheckGroupSelector(groupselector));

 group.add(auftragDataView);

 resultListContainer.add(new PagingNavigator(navigator,
 auftragDataView));

 resultListContainer.add(group);

 form.add(resultListContainer);

 this.add(form);

   }
 }

 public class AuftragDataView extends DataView {

   public AuftragDataView(String id, IDataProvider dataProvider, int
 itemsPerPage) {
 super(id, dataProvider, itemsPerPage);
   }

   @Override
   protected void populateItem(final Item item) {

 final PartnerAuftrag auftrag = (PartnerAuftrag)
 item.getModelObject();
 item.add(new Label(auftragsnummer, auftrag.getAuftragsnummer()));
 ...

 item.add(new Link(update, new Model(auftrag)) {
   public void onClick() {
 AuftragBearbeiten page = new AuftragBearbeiten((PartnerAuftrag)
 getModelObject());
 setResponsePage(page);
   }
 });

 item.add(new AttributeModifier(class, true, new
 AbstractReadOnlyModel() {
   public Object getObject() {
 return (item.getIndex() % 2 == 1) ? even : odd;
   }
 }));
   }

   @Override
   protected void onDetach() {
 super.onDetach();
   }
 }

 public class AuftragDataProvider implements IDataProvider {

   private AuftragBA  auftragBA;
   private AuftragUebersichtQuery query;

   private CollectionPartnerAuftrag result;

   public AuftragDataProvider(AuftragUebersichtQuery query, AuftragBA
 auftragBA) {
 this.query = query;
 this.auftragBA = auftragBA;
   }

   public AuftragUebersichtQuery getQuery() {
 return this.query;
   }

   public void setQuery(AuftragUebersichtQuery query) {
 this.query = query;
 this.result = null;
   }

   public IteratorPartnerAuftrag iterator(int first, int count) {
 if (this.result == null) {
   this.performQuery();
 }
 return new ArrayListPartnerAuftrag(this.result).subList(first,
 first + count).iterator();
   }

   public IModel model(final Object object) {
 return new DetachablePartnerAuftragModel((PartnerAuftrag) object,
 this.auftragBA);
   }

   public int size() {
 if (this.result == null) {
   this.performQuery();
 }
 return this.result.size();
   }

   public void detach() {