Another issue with EventListener

8 views
Skip to first unread message

Lizard Lizard

unread,
May 29, 2012, 10:46:15 AM5/29/12
to h2-da...@googlegroups.com
So I've been digging deeper into event listener, and have accomplished
a bit of what I wanted, in terms of getting it to respond, but now I
have found a fairly amusing problem.

I was told earlier that if I wanted to monitor what event listener was
doing, I could create a memory table. Easy enough. Unfortunately...if
I have an INSERT INTO MYTEMPTABLE type command in SetProgress, it
triggers a listener event which calls SetProgress which... well, you
get the idea.

So I need to create a temporary (memory) table on a DB without a
listener, then have the listener be aware of that DB, and create a
connection to it? Am I missing a much simpler way to do this? I must
be. This just seems like too many hoops, and I must be missing the
forest for the trees, to use a really tiresome cliche.

Noel Grandin

unread,
May 29, 2012, 11:27:28 AM5/29/12
to h2-da...@googlegroups.com, Lizard Lizard
Hmm, you may be better off getting your event listener to store data in
a global data structure, and then creating a stored procedure to query
that data-structure.
Anyhow, that's what I'd do.
Probably more than one way to solve this problem.

Lizard Lizard

unread,
May 29, 2012, 11:38:21 AM5/29/12
to Noel Grandin, h2-da...@googlegroups.com
On Tue, May 29, 2012 at 11:27 AM, Noel Grandin <noelg...@gmail.com> wrote:
> Hmm, you may be better off getting your event listener to store data in a
> global data structure, and then creating a stored procedure to query that
> data-structure.
> Anyhow, that's what I'd do.
> Probably more than one way to solve this problem.
>

Oh, there's usually a thousand ways to solve most problems. I just
tend to think of the worst ones first, so, I'm looking to see if
anyone else has solved them.

I'll look into your idea. What I want to avoid is excessive disk
access or DB bloat. I am often working with databases 50+ GB in size
(yes, that's a "G", not an "M") so I want the less disk access I can
get away with. (This is why having a progress meter during long
processes, like uploading or indexing, is so important to me; it's
hard to tell "frozen" from "slow" when the processes are expected to
take a day or more to complete.)
--
=======================
Personal Blog: http://www.xanga.com/lizard_sf
Facebook: http://www.facebook.com/lizard_sf
MrLizard: Gaming and Geekery: http://www.mrlizard.com

Steve McLeod

unread,
May 30, 2012, 3:38:01 AM5/30/12
to h2-da...@googlegroups.com
how about in your eventlistener a simple IF clause:

  public void setProgress(int state, String name, int x, int max) {
    if (name.equals("MYTEMPTABLE")) {
      return;
    }
    ... rest of code to insert into MYTEMPTABLE
Reply all
Reply to author
Forward
0 new messages