archiva-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dário Oliveros <olive...@cpqd.com.br>
Subject Re: Help on how Archiva consumers work
Date Wed, 12 Dec 2007 18:24:42 GMT

In order to get it working, I forced the removal of project model entry from
effective cache (if exists) in the DatabaseCleanupRemoveProjectConsumer
class in case of any artifact model change since last time it was processed.
Please let me know your comments on that.


Dário Oliveros wrote:
> 
> I have a question about effective cache and hope someone can answer me
> that.
> If I delete a project model using DAO, what happens to the effective cache
> ? Does it still keep a reference to the project model recently removed ?
> 
> The reason for asking this is because I am getting an error when
> attempting to add a new project model to database
> (ProjectModelToDatabaseConsumer) that was previously removed by
> DatabaseCleanupRemoveProjectConsumer.
> I noticed the problem when the EffectiveProjectModelFilter filter
> operation was invoked causing some fields to be null, since it retrieved a
> model from cache, and resulting in an error when trying to save it to
> database using JDO.
> 
> Any pointers would be appreciated.
> 
> 
> brettporter wrote:
>> 
>> http://maven.apache.org/developers/maven-eclipse-codestyle.xml
>> 
>> Thanks!
>> 
>> - Brett
>> 
>> On 12/12/2007, at 10:35 PM, Dário Oliveros wrote:
>> 
>>>
>>> Thank you for letting me contribute with such a nice project. I  
>>> appreciate
>>> it.
>>> BTW do you happen to have any code style formatter profile for Eclipse
>>> Europa ? I noticed Archiva's is a little bit different from Java  
>>> Convention
>>> profile and I could not find it anywhere.
>>> Thanks.
>>>
>>>
>>> Maria Odea Ching-2 wrote:
>>>>
>>>> Okey dokey, thanks a lot Dario!  :-)
>>>>
>>>> -Deng
>>>>
>>>> Dário Oliveros wrote:
>>>>> Good to hear from you.
>>>>>
>>>>> I had made some code changes before getting your response back and
>>>>> surprisingly I was on the right track by working on pretty much  
>>>>> the same
>>>>> steps as you've suggested in the first place. The only difference  
>>>>> was
>>>>> regarding the UnprocessedArtifactPredicate to where I added a new
>>>>> condition
>>>>> for checking whether whenProcessed date is before lastModified  
>>>>> instead of
>>>>> using snapshot verification. Besides I changed the else statement of
>>>>> ArtifactsProcessedConstraint by adding the same verification as  
>>>>> shown
>>>>> previously:
>>>>> whereClause = "whenProcessed == null || (whenProcessed != null &&
>>>>> whenProcessed < lastModified)";
>>>>> In your third step, I went for the date checking instead of  
>>>>> checksum.
>>>>>
>>>>> Anyway it looks like your second solution is better since it tends  
>>>>> to be
>>>>> cleaner than the first one.
>>>>> I will take a look and let you know as soon as I can. Once I fix the
>>>>> issue,
>>>>> I will post the patch for your analysis.
>>>>>
>>>>> Thank you so much for your support.
>>>>>
>>>>>
>>>>>
>>>>> Maria Odea Ching-2 wrote:
>>>>>
>>>>>> Hi Dario,
>>>>>>
>>>>>> I think the solution you've proposed would work.. to implement  
>>>>>> it, these
>>>>>> are probably what you need to change in Archiva:
>>>>>>
>>>>>> 1. update the UnprocessedArtifactPredicate
>>>>>>    - add the constraint to get the SNAPSHOT artifacts as you've
>>>>>> mentioned (there is a 'snapshot' field in the  
>>>>>> ArchivaArtifactModel which
>>>>>> flags whether the artifact is a snapshot or not, though using  
>>>>>> this would
>>>>>> return all snapshots -- unique & non-unique)
>>>>>>
>>>>>> 2. update UnprocessedArtifactPredicate
>>>>>>    - add check if artifact isProcessed() OR isSnapshot() for the
>>>>>> condition the artifact needs to satisfy
>>>>>>
>>>>>> 3. update ProjectModelToDatabaseConsumer
>>>>>>    - in the statement if( hasProjectModelInDatabase(...) ) is
>>>>>> satisfied, the project model/pom file should be verified against
 
>>>>>> the
>>>>>> existing project model (in the db) if there were updates or  
>>>>>> changes made
>>>>>> to it (maybe via the lastModified date or via its checksum). If 

>>>>>> there
>>>>>> are changes, then the existing project model must be removed from
 
>>>>>> the db
>>>>>> and the new project model shall be added.
>>>>>>
>>>>>>
>>>>>> I've also thought of another way to tackle this issue..
>>>>>>
>>>>>> You could just update the  
>>>>>> DatabaseCleanupRemoveProjectModelConsumer to
>>>>>> add checking for changes in the project models/pom files of those
>>>>>> artifacts that have already been processed. If the project model
 
>>>>>> has
>>>>>> been changed, just remove the project model from the db and  
>>>>>> update the
>>>>>> ArchivaArtifactModel's "whenProcessed" field to NULL so that it 

>>>>>> would
>>>>>> qualify in the UnProcessedArtifactPredicate(false) constraint.  
>>>>>> The other
>>>>>> thing that needs to be done is to update the JdoDatabaseUpdater's
>>>>>> update() method -- just switch the lines updateAllUnprocessed() and
>>>>>> updateAllProcessed() inside it. updateAllProcessed() should be  
>>>>>> executed
>>>>>> first  before updateAllUnprocessed() in order to capture the  
>>>>>> updates
>>>>>> performed in DatabaseCleanupRemoveProjectModelConsumer.
>>>>>>
>>>>>> More thoughts/suggestions anyone? :-)
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Deng
>>>>>>
>>>>>>
>>>>>> Dário Oliveros wrote:
>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I would like to understand why a processed artifact does not
have
>>>>>>> update-db-project consumer in case of a non-unique SNAPSHOT 

>>>>>>> project
>>>>>>> (please
>>>>>>> refer to http://jira.codehaus.org/browse/MRM-622 for more  
>>>>>>> information).
>>>>>>>
>>>>>>> The reason for bringing this up is that the database is not being
>>>>>>> updated
>>>>>>> accordingly when a non-unique SNAPSHOT project with dependency
 
>>>>>>> version
>>>>>>> changes is deployed once again to Archiva repository. Even  
>>>>>>> though it
>>>>>>> contains differences compared to the previous one, it's considered
>>>>>>> processed
>>>>>>> already and therefore not updated. It looks like a bug in my
 
>>>>>>> opinion
>>>>>>> and
>>>>>>> I
>>>>>>> would like to contribute for this fix.
>>>>>>>
>>>>>>> Should I change the query constraint for unprocessed artifacts
>>>>>>> (ArtifactsProcessedConstraint(false)) so it also retrieves the
>>>>>>> non-unique
>>>>>>> SNAPSHOT projects or add a new consumer to processed artifacts
for
>>>>>>> database
>>>>>>> update ?
>>>>>>>
>>>>>>> Any tips or pointers would be appreciated.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Dário
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/Help-on-how-Archiva-consumers-work-tp14272457p14293357.html
>>> Sent from the archiva-dev mailing list archive at Nabble.com.
>>>
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Help-on-how-Archiva-consumers-work-tp14272457p14300973.html
Sent from the archiva-dev mailing list archive at Nabble.com.


Mime
View raw message