Automatonymous - compound state nhibernate

116 views
Skip to first unread message

luca giordano

unread,
May 14, 2013, 5:14:17 AM5/14/13
to masstransit-discuss
Hi all,
the exception:
Unable to cast object of type 'Automatonymous.CompositeEventStatus' to
type 'Automatonymous.State'....
at
Automatonymous.NHibernateIntegration.CompositeEventStateUserType.NHibernate.UserTypes.IUserType.Equals(Object
x, Object y)


The map

public class CatalogSagaMap :
ClassMap<CatalogInstance>
{
public CatalogSagaMap()
{
Id(x => x.CorrelationId).GeneratedBy.Assigned();
Map(x =>
x.CompositeStatus).CustomType<CompositeEventStateUserType>();
....
}
}

The instance

public class CatalogInstance : SagaStateMachineInstance
{
public CatalogInstance()
{

}
public CatalogInstance(Guid correlationId)
:this()
{
CorrelationId = correlationId;
}

public CompositeEventStatus CompositeStatus { get; set; }
..........
public Guid CorrelationId { get; set; }
public IServiceBus Bus { get; set; }


}


And the Saga
....
public class CatalogSaga :
AutomatonymousStateMachine<CatalogInstance>
{

public CatalogSaga()
{
InstanceState(x => x.CurrentState);

Event(() => PreCheckAcknowledged);
Event(() => PreCheckCompleted);
Event(() => PreChecked, x => x.CompositeStatus,
PreCheckAcknowledged, PreCheckCompleted);
................
}
public Event<PreconditionChecked> PreCheckCompleted { get;
private set; }
public Event<Acknowledge<PreConditionCheck>>
PreCheckAcknowledged { get; private set; }
public Event PreChecked { get; private set; }
.....

Everything works fine - in memory - but I'm not able to persist the
CompositeEventStatus through nhibernate.
It should be mapped on an int type. If I let the framework create the
table (sqlserver) it's mapped as varbinary(max) unless registered as
customtype :( .
If customtype used there's no way to use nhibernate because of the
exception above.

Any help would be appreciated.
Thanks,
Luca



Chris Patterson

unread,
May 14, 2013, 11:42:28 AM5/14/13
to masstrans...@googlegroups.com
The NHibernate integration classes are not finished yet, and the composite event state is clearly broken as it is trying to cast to the State, so yeah, that will need finished and unit tested.





--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Reply all
Reply to author
Forward
0 new messages