Storage of dynamic attributes in tango database

Hi all,

In which table of tango database are the dynamic attributes stored after their creation ?
Can anyone guide with respect to this ?

Thanks,
Aishwarya
Regards,
TCS_GMRT
Hi Aishwarya,

The dynamic attributes are not stored in the tango database.
Their eventual corresponding attribute properties might be stored in the tango DB if they are different than the default values.
The device server process has the knowledge of its attributes lists.
There is also a system property (Edit->Show system property in jive to be able to see it) which is listing the list of polled attributes (polled_attr property on the admin device).
What are you really looking for?

Cheers,
Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Hi Reynald,

Using dynamicManager.add() method, we successfully created dynamic attributes. But during their removal using dynamicManager.remove() functionality, some of them are not deleted and their values are visible on GUI which creates problem for the entire application. Hence, I was trying to find a solution in which these attributes can be deleted forcefully from database. Is there any specific reason for this ? And is there any solution through which these attributes even if failed to delete in dynamicManager.remove() method, can be deleted forcefully ?

Thanks,
Aishwarya
Regards,
TCS_GMRT
TCS_GMRT
But during their removal using dynamicManager.remove() functionality, some of them are not deleted and their values are visible on GUI which creates problem for the entire application.

If you restart your GUI after the attributes removal, do you still see these attributes?
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Hi Reynald,

After GUI restart the attributes are visible because they are present on device server even after their deletion. But after device server restart, these attributes are gone.

For example, if I am creating 5 dynamic attributes, on calling dynamicManager.removeAttribute() method 1 or 2 gets deleted(sometimes) and others don't get deleted(sometimes). How to address this ?

Thanks,
Aishwarya
Regards,
TCS_GMRT
Hello Aishwarya,

Could you share your code?

Here is an example code to add and remove attributes either at init or inside a command. It works fine for me:

@Device
public class DynamicAttrServer {

    @DynamicManagement
    public DynamicManager dynamicManager;
    @DeviceManagement
    public DeviceManager deviceManager;

    @Init
    public void init() throws DevFailed {
        dynamicManager.addAttribute(new MyDynamicAttribute("atInit"));
    }

    @Delete
    public void delete() throws DevFailed {
        dynamicManager.clearAll();
    }

    @Command
    public void createDynamicAttribute(String name) throws DevFailed {
        dynamicManager.addAttribute(new MyDynamicAttribute(name));
        dynamicManager.loadAttributeConfigFromDb(name);
        if (deviceManager.isPolled(name)) {
            deviceManager.startPolling(name);
        }
    }

    @Command
    public void removeDynamicAttribute(String name) throws DevFailed {
        // removed dynamic attribute but keep its properties in TangoDB
        dynamicManager.removeAttribute(name);
    }

    @Command
    public void removedDynamicAttributeAndItsProperties(String name) throws DevFailed {
        // removed dynamic attribute and its properties in TangoDB
        deviceManager.removeAttributeProperties(name);
        dynamicManager.removeAttribute(name);
    }


    public void setDynamicManager(DynamicManager dynamicManager) {
        this.dynamicManager = dynamicManager;
    }

    public void setDeviceManager(DeviceManager deviceManager) {
        this.deviceManager = deviceManager;
    }
}
Hi Gwen,

Thanks for the example code. We are using the same methods for creating and deleting dynamic attributes. We faced that issue while we creating and deleting attributes with same name again and again. For example I created one dynamic attribute named check_project and after successful creation and deletion, again I went for same procedure(creation and deletion many times) I created same name attribute(check_project) and when I wanted to delete I got error -
(We have lot of code dependencies hence cannot share the entire code)

2018-12-19 12:48:39.360 AttributeOperations: - Execption occured while removing dynamic attrs
fr.esrf.TangoApi.CommunicationTimeout: IDL:Tango/DevFailed:1.0
at fr.esrf.TangoDs.Except.throw_communication_timeout(Except.java:739) ~
at fr.esrf.TangoDs.Except.throw_communication_timeout(Except.java:661) ~
at fr.esrf.TangoApi.ConnectionDAODefaultImpl.throw_dev_failed(ConnectionDAODefaultImpl.java:789) ~
at fr.esrf.TangoApi.ConnectionDAODefaultImpl.manageExceptionReconnection(ConnectionDAODefaultImpl.java:1340) ~
at fr.esrf.TangoApi.ConnectionDAODefaultImpl.command_inout(ConnectionDAODefaultImpl.java:925) ~
at fr.esrf.TangoApi.Connection.command_inout(Connection.java:375) ~
at org.tcs.ncra.gmrt.attributeoperation.AttributeOperations.removeDynamicAttr(Unknown Source) ~
at org.tcs.ncra.gmrt.threads.PostProcessing.run(Unknown Source) ~
at java.lang.Thread.run(Thread.java:748)


For communication timeout I externally written in code for extended time for tango command.
DeviceProxy.set_timeout_millis(40000); and after the execution of that particular tango command is done, the timeout is set back to 3 seconds.


Regards,
TCS_GMRT
Hi,

I am not able to reproduce your problem. Here is a sample client code I used to perform some tests:

 int i = 0;
        while (i < 10000) {
            TangoCommand cmd = new TangoCommand("tango9/java/dynamic-attr.1/createDynamicAttribute");
            cmd.execute("test");
            TangoAttribute tangoAttribute = new TangoAttribute("tango9/java/dynamic-attr.1/test");
            System.out.println(tangoAttribute.read());
            TangoCommand delete = new TangoCommand("tango9/java/dynamic-attr.1/removeDynamicAttribute");
            delete.execute("test");
            i++;
        }

Could you add the error stack trace of the server? I suspect a problem in the code of your dynamic attribute.
Hi Gwen,

Please find attached document. You can find in many places tango communication timeout at the time of dynamic attribute creation and deletion. The dynamic attribute creation and deletion behaviour unknown (sometimes). I hope you can debug something from the attached file. Let me know if you need any information/description.
Regards,
TCS_GMRT
Hello,

Is you logs are really from your tango server? for me it is a client log:

[ERROR] 2018-12-20 15:55:42.872 AttributeOperations:  - Exception occured while adding dynamic attribute : - 
fr.esrf.TangoApi.CommunicationTimeout: IDL:Tango/DevFailed:1.0
	at fr.esrf.TangoDs.Except.throw_communication_timeout(Except.java:739) ~[JTango-9.5.0.jar:?]
	at fr.esrf.TangoDs.Except.throw_communication_timeout(Except.java:661) ~[JTango-9.5.0.jar:?]
	at fr.esrf.TangoApi.ConnectionDAODefaultImpl.throw_dev_failed(ConnectionDAODefaultImpl.java:789) ~[JTango-9.5.0.jar:?]
	at fr.esrf.TangoApi.ConnectionDAODefaultImpl.manageExceptionReconnection(ConnectionDAODefaultImpl.java:1340) ~[JTango-9.5.0.jar:?]
	at fr.esrf.TangoApi.ConnectionDAODefaultImpl.command_inout(ConnectionDAODefaultImpl.java:925) ~[JTango-9.5.0.jar:?]
	at fr.esrf.TangoApi.Connection.command_inout(Connection.java:375) ~[JTango-9.5.0.jar:?]
	at org.tcs.ncra.gmrt.attributeoperation.AttributeOperations.addDynamicAttr(Unknown Source) ~[lmcclient_3.7.0.jar:?]
	at org.tcs.ncra.gmrt.attributeoperation.AttributeOperations.createDynamicAttr(Unknown Source) ~[lmcclient_3.7.0.jar:?]
	at org.tcs.ncra.gmrt.threads.PostProcessing.run(Unknown Source) ~[lmcclient_3.7.0.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]

Or maybe, you have a device that is connected to another device? When you create a dynamic attribute, it executes a command to another device that throws a timeout.

The logs from the server side starts with org.tango.server…
 
Register or login to create to post a reply.