You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Adam Heath <do...@brainfood.com> on 2012/05/31 18:10:01 UTC

Component/TenantComponent entities

Component/TenantComponent entities are defined in framework/entity.
However, that code does not use them.  entityext does.  They should be
moved to the later component.

I've currently got org.ofbiz.entity.Main that can load a delegator,
without any of service or any other component loaded.  No entities are
defined in this mode, but the code does the correct thing.  I'm
planning on removing framework/entity/entitydef from the
ofbiz-component.xml, and force-loading these always-required entities.
 However, since Component/TenantComponent are not requried by the
entity engine, I want to move them.

Re: Component/TenantComponent entities

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
On Jun 1, 2012, at 7:06 PM, Adam Heath wrote:

>> But in one sentence I would like to integrate a tm that supports the recovery of transactions... and in the way it is currently integrated in OFBiz, Geronimo TM doesn't support this.
> 
> Would it be possible to change the geronimo integration?

Yes, in fact I started with this and I have a local modification that I may be able to contribute soon; the idea is to setup the Geronimo TM with a different "transaction log" class:
* we are currently using the UnrecoverableLog class and and this is not a reliable solution [*]
* Geronimo provides a "transaction log" based on Howl [**] and this is the one I was able to plug in (with some work) in my local copy

However I also faced some issues and the documentation of Geronimo in this area is very poor; also extracting the TM from new releases of Geronimo is challenging (this has been challenging also in the past but in the new release I couldn't even find the separate jars); also the fact that Geronimo TM bases its core operations on Howl may be a little concerning as Howl's last release was in January 2007.

Even if none of the above issues may block us to enhance the current Geronimo integration (and as I wrote, I may be able to provide an enhancement for it), they made me spend some time researching for other more modern solutions and I came to Atomikos TransactionsEssentials [***] that seems to be a valid solution, actively maintained and adopted by several open source projects (including David's Moqui); its license is ASL2.0.

But yeah, I am still working on this and I will keep you updated on the outcome.

Regards,

Jacopo


[*] This is a comment from the class's source file:

/**
 * A log sink that doesn't actually do anything.
 * Not recommended for production use as heuristic recovery will be needed if
 * the transaction coordinator dies.
 */


[**] http://howl.ow2.org/

[***] http://www.atomikos.com/Main/TransactionsEssentials

Re: Component/TenantComponent entities

Posted by Adam Heath <do...@brainfood.com>.
On 06/01/2012 11:52 AM, Jacopo Cappellato wrote:
>
> On Jun 1, 2012, at 6:48 PM, Jacopo Cappellato wrote:
>
>>
>> On Jun 1, 2012, at 5:52 PM, Adam Heath wrote:
>>
>>> What is different about the new implementation?  Or what problems are you trying to solve?
>>
>> I am in a rush now, I am sorry but I will share details about what I am trying to do and why.
>>
>
> But in one sentence I would like to integrate a tm that supports the recovery of transactions... and in the way it is currently integrated in OFBiz, Geronimo TM doesn't support this.

Would it be possible to change the geronimo integration?  Tbh, I have no 
idea what transaction recovery means.  Is it something to do with 
savepoints?

Re: Component/TenantComponent entities

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
On Jun 1, 2012, at 6:48 PM, Jacopo Cappellato wrote:

> 
> On Jun 1, 2012, at 5:52 PM, Adam Heath wrote:
> 
>> What is different about the new implementation?  Or what problems are you trying to solve?
> 
> I am in a rush now, I am sorry but I will share details about what I am trying to do and why.
> 

But in one sentence I would like to integrate a tm that supports the recovery of transactions... and in the way it is currently integrated in OFBiz, Geronimo TM doesn't support this.

Jacopo

Re: Component/TenantComponent entities

Posted by Adam Heath <do...@brainfood.com>.
On 06/01/2012 11:48 AM, Jacopo Cappellato wrote:
>
> On Jun 1, 2012, at 5:52 PM, Adam Heath wrote:
>
>> What is different about the new implementation?  Or what problems are you trying to solve?
>
> I am in a rush now, I am sorry but I will share details about what I am trying to do and why.

Not a problem, I'll call you a bee.

Re: Component/TenantComponent entities

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
On Jun 1, 2012, at 5:52 PM, Adam Heath wrote:

> What is different about the new implementation?  Or what problems are you trying to solve?

I am in a rush now, I am sorry but I will share details about what I am trying to do and why.

Jacopo

Re: Component/TenantComponent entities

Posted by Adrian Crum <ad...@sandglass-software.com>.
On 6/1/2012 6:26 PM, Adam Heath wrote:
> On 06/01/2012 12:16 PM, Adrian Crum wrote:
>> On 6/1/2012 4:55 PM, Adam Heath wrote:
>>> On 06/01/2012 10:52 AM, Adam Heath wrote:
>>>> On 06/01/2012 10:20 AM, Jacopo Cappellato wrote:
>>>>>
>>>>> On Jun 1, 2012, at 4:59 PM, Adam Heath wrote:
>>>>>
>>>>>> entity depends on geronimo and entityext components, because of
>>>>>> defaults in the code and entityengine.xml. entityext depends on
>>>>>> service.
>>>>>
>>>>> as a side note: I am currently working at the implementation of a
>>>>> transaction manager and connection pool based on Atomikos
>>>>> TransactionsEssentials that could replace Geronimo and DBCP.
>>>>
>>>> What is different about the new implementation? Or what problems 
>>>> are you
>>>> trying to solve?
>>>
>>> Tbh, I've always wondered why TransactionUtil exists in
>>> framework/entity. I'd almost like to see that move out to it's own
>>> component, before entity in the order.
>>
>> Handling transactions in a generic way would be nice to have - so that
>> things other than database updates can be included in a transaction.
>
> That's already possible, you can enlist a resource into the transaction.

Cool - thanks!

-Adrian


Re: Component/TenantComponent entities

Posted by Adam Heath <do...@brainfood.com>.
On 06/01/2012 12:16 PM, Adrian Crum wrote:
> On 6/1/2012 4:55 PM, Adam Heath wrote:
>> On 06/01/2012 10:52 AM, Adam Heath wrote:
>>> On 06/01/2012 10:20 AM, Jacopo Cappellato wrote:
>>>>
>>>> On Jun 1, 2012, at 4:59 PM, Adam Heath wrote:
>>>>
>>>>> entity depends on geronimo and entityext components, because of
>>>>> defaults in the code and entityengine.xml. entityext depends on
>>>>> service.
>>>>
>>>> as a side note: I am currently working at the implementation of a
>>>> transaction manager and connection pool based on Atomikos
>>>> TransactionsEssentials that could replace Geronimo and DBCP.
>>>
>>> What is different about the new implementation? Or what problems are you
>>> trying to solve?
>>
>> Tbh, I've always wondered why TransactionUtil exists in
>> framework/entity. I'd almost like to see that move out to it's own
>> component, before entity in the order.
>
> Handling transactions in a generic way would be nice to have - so that
> things other than database updates can be included in a transaction.

That's already possible, you can enlist a resource into the transaction.

Re: Component/TenantComponent entities

Posted by Adrian Crum <ad...@sandglass-software.com>.
On 6/1/2012 4:55 PM, Adam Heath wrote:
> On 06/01/2012 10:52 AM, Adam Heath wrote:
>> On 06/01/2012 10:20 AM, Jacopo Cappellato wrote:
>>>
>>> On Jun 1, 2012, at 4:59 PM, Adam Heath wrote:
>>>
>>>> entity depends on geronimo and entityext components, because of
>>>> defaults in the code and entityengine.xml. entityext depends on 
>>>> service.
>>>
>>> as a side note: I am currently working at the implementation of a
>>> transaction manager and connection pool based on Atomikos
>>> TransactionsEssentials that could replace Geronimo and DBCP.
>>
>> What is different about the new implementation? Or what problems are you
>> trying to solve?
>
> Tbh, I've always wondered why TransactionUtil exists in 
> framework/entity.  I'd almost like to see that move out to it's own 
> component, before entity in the order.

Handling transactions in a generic way would be nice to have - so that 
things other than database updates can be included in a transaction.

-Adrian


Re: Component/TenantComponent entities

Posted by Adam Heath <do...@brainfood.com>.
On 06/01/2012 10:52 AM, Adam Heath wrote:
> On 06/01/2012 10:20 AM, Jacopo Cappellato wrote:
>>
>> On Jun 1, 2012, at 4:59 PM, Adam Heath wrote:
>>
>>> entity depends on geronimo and entityext components, because of
>>> defaults in the code and entityengine.xml. entityext depends on service.
>>
>> as a side note: I am currently working at the implementation of a
>> transaction manager and connection pool based on Atomikos
>> TransactionsEssentials that could replace Geronimo and DBCP.
>
> What is different about the new implementation? Or what problems are you
> trying to solve?

Tbh, I've always wondered why TransactionUtil exists in 
framework/entity.  I'd almost like to see that move out to it's own 
component, before entity in the order.

Re: Component/TenantComponent entities

Posted by Adam Heath <do...@brainfood.com>.
On 06/01/2012 10:20 AM, Jacopo Cappellato wrote:
>
> On Jun 1, 2012, at 4:59 PM, Adam Heath wrote:
>
>> entity depends on geronimo and entityext components, because of defaults in the code and entityengine.xml.  entityext depends on service.
>
> as a side note: I am currently working at the implementation of a transaction manager and connection pool based on Atomikos TransactionsEssentials that could replace Geronimo and DBCP.

What is different about the new implementation?  Or what problems are 
you trying to solve?

Re: Component/TenantComponent entities

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
On Jun 1, 2012, at 4:59 PM, Adam Heath wrote:

> entity depends on geronimo and entityext components, because of defaults in the code and entityengine.xml.  entityext depends on service.

as a side note: I am currently working at the implementation of a transaction manager and connection pool based on Atomikos TransactionsEssentials that could replace Geronimo and DBCP.

Jacopo

Re: Component/TenantComponent entities

Posted by Adam Heath <do...@brainfood.com>.
On 06/01/2012 01:53 AM, Jacopo Cappellato wrote:
>
> On May 31, 2012, at 6:10 PM, Adam Heath wrote:
>
>> Component/TenantComponent entities are defined in framework/entity.
>> However, that code does not use them.  entityext does.  They should be
>> moved to the later component.
>
> +1
>
>>
>> I've currently got org.ofbiz.entity.Main that can load a delegator,
>> without any of service or any other component loaded.  No entities are
>> defined in this mode, but the code does the correct thing.  I'm
>> planning on removing framework/entity/entitydef from the
>> ofbiz-component.xml, and force-loading these always-required entities.
>
> Hmmmm.... if I understand correctly I am not sure I like it: the entity component currently depends on "base" component as mostly all the other framework components and before changing this we should discuss the architecture and motivations for this change.

entity depends on geronimo and entityext components, because of defaults 
in the code and entityengine.xml.  entityext depends on service.

One of the jira issues listed in the README in the new branch talks 
about having the entity engine as a standalone component.  I'm almost 
there.  I implemented a do-nothing eca handler(to remove the dep on 
entityext/service).  Haven't yet done the transaction handler yet.

This would allow for api testing in a quick manner.

Re: Component/TenantComponent entities

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
On May 31, 2012, at 6:10 PM, Adam Heath wrote:

> Component/TenantComponent entities are defined in framework/entity.
> However, that code does not use them.  entityext does.  They should be
> moved to the later component.

+1

> 
> I've currently got org.ofbiz.entity.Main that can load a delegator,
> without any of service or any other component loaded.  No entities are
> defined in this mode, but the code does the correct thing.  I'm
> planning on removing framework/entity/entitydef from the
> ofbiz-component.xml, and force-loading these always-required entities.

Hmmmm.... if I understand correctly I am not sure I like it: the entity component currently depends on "base" component as mostly all the other framework components and before changing this we should discuss the architecture and motivations for this change.

Jacopo

> However, since Component/TenantComponent are not requried by the
> entity engine, I want to move them.