How to update GL eventlist from database?

View: New views
4 Messages — Rating Filter:   Alert me  

How to update GL eventlist from database?

by philk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I am struggling with updating my EventList with data from a database. I do full table updates with the result set from the DB query like this:
GlazedLists.replaceAllSorted(items, getDBResult(), true, null);

All items are Comparable. However the update of the list is kind of akward. The UI refreshes very slowly. I will make a video of it later. Maybe its a threading issue? I am using a thread-safe base list for my items. Maybe I should manually lock and unlock the table?

Do you have any recommendations on how to do full table updates using DB results?

Thanks!

re: How to update GL eventlist from database?

by Kevin Day-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
I haven't seen a response to this yet...  Here's what's probably going on (these are from the javadocs on the ThreadSafeList factory method):
 

* <p>Using a {@link ThreadSafeList} for concurrent access to lists can be expensive

* because a {@link ca.odell.glazedlists.util.concurrent.ReadWriteLock ReadWriteLock}

* is aquired and released for every operation.

 

 

So replaceAllSorted is making a huge number of lock/unlock calls.  You would be much better off managing the locks yourself, or doing these sorts of huge list updates to a list upstream of the ThreadSafeList (you'll still have to manage the locks for the big updates, natch).

 

- K


 
----------------------- Original Message -----------------------
  
From: philk phil.kursawe@...
Cc: 
Date: Mon, 22 Jun 2009 13:16:07 -0700 (PDT)
Subject: How to update GL eventlist from database?
  

Hello,

I am struggling with updating my EventList with data from a database. I do
full table updates with the result set from the DB query like this:
GlazedLists.replaceAllSorted(items, getDBResult(), true, null);

All items are Comparable. However the update of the list is kind of akward.
The UI refreshes very slowly. I will make a video of it later. Maybe its a
threading issue? I am using a thread-safe base list for my items. Maybe I
should manually lock and unlock the table?

Do you have any recommendations on how to do full table updates using DB
results?

Thanks!
--
View this message in context: http://www.nabble.com/How-to-update-GL-eventlist-from-database--tp24154589p24154589.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.


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


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

re[2]: How to update GL eventlist from database?

by Kevin Day-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Just to clarify:  replaceAllSorted is not making the lock/unlock calls - it is just performing get and set operations.  The ThreadSafeList is making all the lock/unlock calls, as the get/set calls are made by replaceAllSorted.
 
- K
 
----------------------- Original Message -----------------------
  
From: Kevin Day kevin@...
To: Glazed Lists users@...
Cc: 
Date: Tue, 23 Jun 2009 16:10:40 -0700
Subject: re: How to update GL eventlist from database?
  
I haven't seen a response to this yet...  Here's what's probably going on (these are from the javadocs on the ThreadSafeList factory method):
 

* <p>Using a {@link ThreadSafeList} for concurrent access to lists can be expensive

* because a {@link ca.odell.glazedlists.util.concurrent.ReadWriteLock ReadWriteLock}

* is aquired and released for every operation.

 

 

So replaceAllSorted is making a huge number of lock/unlock calls.  You would be much better off managing the locks yourself, or doing these sorts of huge list updates to a list upstream of the ThreadSafeList (you'll still have to manage the locks for the big updates, natch).

 

- K


 
----------------------- Original Message -----------------------
  
From: philk phil.kursawe@...
Cc: 
Date: Mon, 22 Jun 2009 13:16:07 -0700 (PDT)
Subject: How to update GL eventlist from database?
  

Hello,

I am struggling with updating my EventList with data from a database. I do
full table updates with the result set from the DB query like this:
GlazedLists.replaceAllSorted(items, getDBResult(), true, null);

All items are Comparable. However the update of the list is kind of akward.
The UI refreshes very slowly. I will make a video of it later. Maybe its a
threading issue? I am using a thread-safe base list for my items. Maybe I
should manually lock and unlock the table?

Do you have any recommendations on how to do full table updates using DB
results?

Thanks!
--
View this message in context: http://www.nabble.com/How-to-update-GL-eventlist-from-database--tp24154589p24154589.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.


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


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

Re: re[2]: How to update GL eventlist from database?

by philk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you Kevin, you saved my day!
I replaced the ThreadSafeList everywhere (basically it was my bast list to all viewers). The speed improvement is next to nothing! Now I can even think about owner drawing my tables again :)

Thanks alot!

Kevin Day wrote:





Just to clarify:  replaceAllSorted is not making the lock/unlock calls - it is just performing get and set operations.  The ThreadSafeList is making all the lock/unlock calls, as the get/set calls are made by replaceAllSorted.
 
- K
 

----------------------- Original Message -----------------------
  
From: Kevin Day <kevin@trumpetinc.com>
To: Glazed Lists <users@glazedlists.dev.java.net>
Cc: 
Date: Tue, 23 Jun 2009 16:10:40 -0700
Subject: re: How to update GL eventlist from database?
  
I haven't seen a response to this yet...  Here's what's probably going on (these are from the javadocs on the ThreadSafeList factory method):
 
* <p>Using a {@link ThreadSafeList} for concurrent access to lists can be expensive
* because a {@link ca.odell.glazedlists.util.concurrent.ReadWriteLock ReadWriteLock}
* is aquired and released for every operation.
 
 
So replaceAllSorted is making a huge number of lock/unlock calls.  You would be much better off managing the locks yourself, or doing these sorts of huge list updates to a list upstream of the ThreadSafeList (you'll still have to manage the locks for the big updates, natch).
 
- K

 

----------------------- Original Message -----------------------
  
From: philk <phil.kursawe@gmail.com>
To:  users@glazedlists.dev.java.net
Cc: 
Date: Mon, 22 Jun 2009 13:16:07 -0700 (PDT)
Subject: How to update GL eventlist from database?
  
Hello, I am struggling with updating my EventList with data from a database. I do full table updates with the result set from the DB query like this: GlazedLists.replaceAllSorted(items, getDBResult(), true, null); All items are Comparable. However the update of the list is kind of akward. The UI refreshes very slowly. I will make a video of it later. Maybe its a threading issue? I am using a thread-safe base list for my items. Maybe I should manually lock and unlock the table? Do you have any recommendations on how to do full table updates using DB results? Thanks! -- View this message in context: http://www.nabble.com/How-to-update-GL-eventlist-from-database--tp24154589p24154589.html Sent from the GlazedLists - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glazedlists.dev.java.net For additional commands, e-mail: users-help@glazedlists.dev.java.net --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glazedlists.dev.java.net For additional commands, e-mail: users-help@glazedlists.dev.java.net


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glazedlists.dev.java.net
For additional commands, e-mail: users-help@glazedlists.dev.java.net