Re: [Informa-developer] Update channels problem
Status: Beta
Brought to you by:
niko_schmuck
From: Aleksey G. <spy...@no...> - 2005-01-31 15:43:34
|
Marco, First off, sorry for a delayed answer. Let me put my comments inline. > I am using poller to get news from a website (reuters). > Problem is that it looks like the same news sometime is repeated twice > (I found same problem with other rss sites, the same news appears more > than once).. > For example, I found same news repeated 3 time at different hours... > title is same, probably description changed a little... so I guess it's > ok. > But I am curious on how could I avoid 'title duplication'.. Poler uses native items matching methods (hashCode/equals) to detect the equality and skips duplicates. In your case it can be a tricky feed. Let me know its URL and I'll check it, OK? Anyway, if you aren't satisfied with the level of duplicates detection you can always write your own Approver (see documentation) to approved addition of newly found article to your channel. > Aleksey, since I get hold of you, could you tell me how could I > integrate > Informa with Spring, for Session management? > > I suppose Hibernate PM uses HibernateUtil to get Session, but I guess it > does so internally.. > Spring as its own HibernateDaoSupport class that handles session, so I > assume if I could call HibernateDaoSupport from Hibernate PM that will > make > The job.... > But from API I see no way on how to 'decouple' Session from Hibernate > PM. > Or, as I said, looks like HibrnatePM uses HibernateUtil internally, so > there is no way that I could set the Session on HibernatePM.. Well, I haven't used Spring framework yet, but anyway. If you look carefully at HibernateUtil.init() you will see that it creates sessionHandler using factory method. Using system properties you can customize the session handler to be created during initialization. There's no way for now to use custom session handlers. That's what related to session management. If you planned to call HibernateDaoSupport methods to load / store the data then I would say that it's not be possible with current Hibernate PM, because it's nearly impossible to delegate persistence-related task to "unknown" code and stay consistent in any case. The manager will not "know" what's happening in the delegated calls, if they are correct and if they do what's expected. Also it wouldn't be possible to place transactions management statements correctly and whole thing can became unstable. Let me know what you think and possibly we could extend the Hibernate PM to support custom session handlers. Thank you, Aleksey |