db4o Developer Community

db4o open source object database, native to Java and .NET
Welcome to db4o Developer Community Sign in | Join
in Search
More Search Options

Getting object by ID vs transparent activation

Last post 10-15-2008, 12:34 PM by db4o.supporter. 7 replies.
Sort Posts: Previous Next
  •  09-01-2008, 06:59 PM 50864

    Getting object by ID vs transparent activation

    Hi,

    we are developing a multiuser client-server application. To make transactions clear and simple, we use a single container to read data and separate object containers for each transaction. To make this possible, we "transport" objects between containers based the internal object Id, thus using IExtObjectContainer.GetById().

    However, when a new object is written into the database in a transaction and I'm trying to read it back in the reader client, I'm experiencing strange behaviour. A resulted object is loaded, but transparent activation completely fails. According to the API documentation, you should call IExtObjectContainer.Activate(obj) after using GetById(), but it fails to load the object members. Strangely, if I specify the activation depth manually as int.MaxValue, it works. However, it loads tons of data so it's unacceptably slow.

    What's so special in this case for transparent activation? Is this a bug or a feature? Am I doing something wrong?

     (I'm using .Net, and the related assembly is instrumented, so transparent activation works fine otherwise. I've tried different versions of the 7.x series, recently 7.4.57)

     thanks

     Istvan

  •  09-13-2008, 11:02 PM 51059 in reply to 50864

    Re: Getting object by ID vs transparent activation

    Hi all,

     I have reconstructed the problem and found that _activator field causes problems here. When an object is the result of a query, activator is bound to an object, but if it's the result of a getByID or getByUUID call, the activator is not set.

    Does anybody knows what's the reason behind this?

    Thanks

     Andras 

      

  •  09-14-2008, 08:54 AM 51060 in reply to 51059

    Re: Getting object by ID vs transparent activation

    Attachment: DualContainer.rar

    I have attached testproject which demonstrates the problem.

     Thanks

     Andras

  •  09-25-2008, 11:47 AM 51224 in reply to 51060

    Re: Getting object by ID vs transparent activation

    Attachment: Activation.zip

    After the suggested modifications, transparent activation still fails in a bit more complex case. I've attached the modified test project.

    Istvan

  •  10-14-2008, 03:12 PM 51526 in reply to 50864

    Re: Getting object by ID vs transparent activation

    You have to instrument any code that touches any public field of TA aware classes. Could you confirm that's true for you scenario?
  •  10-14-2008, 04:45 PM 51528 in reply to 51526

    Re: Getting object by ID vs transparent activation

    Thanks for your help! Meanwhile we solved the problem.

     We referenced a public data member in an instrumented assembly from an uninstrumented one. We transformed the field into a property, now it works.

     Istvan

  •  10-15-2008, 12:20 PM 51547 in reply to 51528

    Re: Getting object by ID vs transparent activation

    Nice.
  •  10-15-2008, 12:34 PM 51548 in reply to 51547

    Re: Getting object by ID vs transparent activation

    If I instrument client then it works without adding properties.
View as RSS news feed in XML