You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Brendan Robert <br...@adobe.com.INVALID> on 2019/05/29 16:51:48 UTC

Sling Models feature proposal: Adding transparent persistence support

I have submitted a new module for consideration which adds a new persistence service.  This service allows saving a java bean back to the JCR.  This allows sling models to be 2-way model beans, useful for all kinds of business logic automation and integration scenarios.

For more information and the donated code including unit test coverage, see the jira issue SLING-8450.

https://issues.apache.org/jira/browse/SLING-8450

Thanks for considering this feature!
-Brendan Robert

Re: Sling Models feature proposal: Adding transparent persistence support

Posted by Nicolas Peltier <np...@apache.org>.
Yes we are on the same page !

Le lun. 24 juin 2019 à 21:16, Brendan Robert <br...@adobe.com.invalid> a
écrit :

> I agree that autosave might make a large performance improvement for large
> operations, but I feel like that would require some kind of overseer to
> make any automatic behavior work correctly.  A fair compromise would be to
> add an optional call to specify autocommit as an optional Boolean (with the
> default value being true because a lot of times this will be used for a
> single record.)  Anyone using the autocommit = false assumes the
> responsibility of committing changes.   If we’re saying the same thing then
> great, I’ll open a new issue for that so the effort is tracked against
> that.  I’m concerned about some edge cases making this a little tricky, but
> I’ll save my breath for Jira. 😃
>
>
>
> -Brendan
>
>
>
> Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> ________________________________
> From: Nicolas Peltier <np...@apache.org>
> Sent: Monday, June 3, 2019 6:54:36 AM
> To: dev@sling.apache.org
> Subject: Re: Sling Models feature proposal: Adding transparent persistence
> support
>
> Hi Brendan,
>
> this is great! I agree with Carsten's feedback in the ticket that we should
> stick in the naming and in the code (RepositoryException e.g.) to the
> resource persistence layer.
> Also, i would find interesting to have an option to defer the commit to an
> upper layer, in case you have many "persist" operations in a row, this
> would be suboptimal. Something like an autosave flag.
>
> Le lun. 3 juin 2019 à 12:12, Brendan Robert <br...@adobe.com.invalid> a
> écrit :
>
> > I have submitted a new module for consideration which adds a new
> > persistence service.  This service allows saving a java bean back to the
> > JCR.  This allows sling models to be 2-way model beans, useful for all
> > kinds of business logic automation and integration scenarios.
> >
> > For more information and the donated code including unit test coverage,
> > see the jira issue SLING-8450.
> >
> >
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fissues.apache.org%2Fjira%2Fbrowse%2FSLING-8450&amp;data=02%7C01%7Cbrobert%40adobe.com%7Cc0b10f64222d4ac9f10808d6e81a47b6%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C636951596924516808&amp;sdata=hahxQJr3RKSkZvU5zmQyEVTA4U89A7SJyhOZnjvBZBo%3D&amp;reserved=0
> >
> > Thanks for considering this feature!
> > -Brendan Robert
> >
>

RE: Sling Models feature proposal: Adding transparent persistence support

Posted by Brendan Robert <br...@adobe.com.INVALID>.
I agree that autosave might make a large performance improvement for large operations, but I feel like that would require some kind of overseer to make any automatic behavior work correctly.  A fair compromise would be to add an optional call to specify autocommit as an optional Boolean (with the default value being true because a lot of times this will be used for a single record.)  Anyone using the autocommit = false assumes the responsibility of committing changes.   If we’re saying the same thing then great, I’ll open a new issue for that so the effort is tracked against that.  I’m concerned about some edge cases making this a little tricky, but I’ll save my breath for Jira. 😃



-Brendan



Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10



________________________________
From: Nicolas Peltier <np...@apache.org>
Sent: Monday, June 3, 2019 6:54:36 AM
To: dev@sling.apache.org
Subject: Re: Sling Models feature proposal: Adding transparent persistence support

Hi Brendan,

this is great! I agree with Carsten's feedback in the ticket that we should
stick in the naming and in the code (RepositoryException e.g.) to the
resource persistence layer.
Also, i would find interesting to have an option to defer the commit to an
upper layer, in case you have many "persist" operations in a row, this
would be suboptimal. Something like an autosave flag.

Le lun. 3 juin 2019 à 12:12, Brendan Robert <br...@adobe.com.invalid> a
écrit :

> I have submitted a new module for consideration which adds a new
> persistence service.  This service allows saving a java bean back to the
> JCR.  This allows sling models to be 2-way model beans, useful for all
> kinds of business logic automation and integration scenarios.
>
> For more information and the donated code including unit test coverage,
> see the jira issue SLING-8450.
>
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fissues.apache.org%2Fjira%2Fbrowse%2FSLING-8450&amp;data=02%7C01%7Cbrobert%40adobe.com%7Cc0b10f64222d4ac9f10808d6e81a47b6%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C636951596924516808&amp;sdata=hahxQJr3RKSkZvU5zmQyEVTA4U89A7SJyhOZnjvBZBo%3D&amp;reserved=0
>
> Thanks for considering this feature!
> -Brendan Robert
>

Re: Sling Models feature proposal: Adding transparent persistence support

Posted by Nicolas Peltier <np...@apache.org>.
Hi Brendan,

this is great! I agree with Carsten's feedback in the ticket that we should
stick in the naming and in the code (RepositoryException e.g.) to the
resource persistence layer.
Also, i would find interesting to have an option to defer the commit to an
upper layer, in case you have many "persist" operations in a row, this
would be suboptimal. Something like an autosave flag.

Le lun. 3 juin 2019 à 12:12, Brendan Robert <br...@adobe.com.invalid> a
écrit :

> I have submitted a new module for consideration which adds a new
> persistence service.  This service allows saving a java bean back to the
> JCR.  This allows sling models to be 2-way model beans, useful for all
> kinds of business logic automation and integration scenarios.
>
> For more information and the donated code including unit test coverage,
> see the jira issue SLING-8450.
>
> https://issues.apache.org/jira/browse/SLING-8450
>
> Thanks for considering this feature!
> -Brendan Robert
>