<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Singleton Object in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-object/m-p/2805575#M655580</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it possible to create systemwide unique objects?&lt;/P&gt;&lt;P&gt;I know of the singleton class, but I do not want to create a unique class instance,&lt;/P&gt;&lt;P&gt;but I want to create some kind of factory class which gives unique objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance I want to create delivery objects and I do not want multiple users&lt;/P&gt;&lt;P&gt;to create the same delivery object (you can imagine why).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings Fred.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Sep 2007 12:42:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-07T12:42:40Z</dc:date>
    <item>
      <title>Singleton Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-object/m-p/2805575#M655580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it possible to create systemwide unique objects?&lt;/P&gt;&lt;P&gt;I know of the singleton class, but I do not want to create a unique class instance,&lt;/P&gt;&lt;P&gt;but I want to create some kind of factory class which gives unique objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance I want to create delivery objects and I do not want multiple users&lt;/P&gt;&lt;P&gt;to create the same delivery object (you can imagine why).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings Fred.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 12:42:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-object/m-p/2805575#M655580</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T12:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Singleton Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-object/m-p/2805576#M655581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Singleton &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is to be impossible to instantiate a class more than once (for example, because it serves as a data administrator or data container), you can use the singleton concept. The class is defined with the addition CREATE PRIVATE and FINAL and instantiated using its static constructor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 13:08:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-object/m-p/2805576#M655581</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T13:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Singleton Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-object/m-p/2805577#M655582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The only really systemwide (User sessin, application servers, etc.) available memory is the database.&lt;/P&gt;&lt;P&gt;So i think the only way to achieve your requirement is to use the Database as global memory.&lt;/P&gt;&lt;P&gt;First&lt;/P&gt;&lt;P&gt;1)Create a DB table that saves the unique criterias of your deliveries.&lt;/P&gt;&lt;P&gt;2)Implement the Semaphore pattern (even using database as global memory)&lt;/P&gt;&lt;P&gt;Your factory have to &lt;/P&gt;&lt;P&gt;1)Lock (Semaphore pattern) the entire table of unique keys. So can you ensure that a another existing factory (for example on a separate application server) creates at the same moment a equal key.&lt;/P&gt;&lt;P&gt;2)Create a key that identifies uniquely your Delivery.&lt;/P&gt;&lt;P&gt;3)Save the key on the database and commit the transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it is possible for your factory (on the other application server or in the other User session) to detect if a user just creates the same delivery.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You shuld not forget to delete the lock also if the user abort the creation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this for you a solution approach?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gianpietro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 13:38:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-object/m-p/2805577#M655582</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T13:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Singleton Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-object/m-p/2805578#M655583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Damn, I was hoping not to have to use a table for this.&lt;/P&gt;&lt;P&gt;I have already build a solution like this, &lt;/P&gt;&lt;P&gt;but thougt that there should be a better way to achieve this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 14:26:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-object/m-p/2805578#M655583</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T14:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Singleton Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-object/m-p/2805579#M655584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Fred&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually I only have a good guess for you but perhaps storing this singleton instance in the &amp;lt;b&amp;gt;shared memory&amp;lt;/b&amp;gt; may be way to match your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sure the new book written by Rich Heilman and Thomas Jung about cutting-edge ABAP techniques will give you indications whether this might be a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 15:45:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-object/m-p/2805579#M655584</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-09-07T15:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Singleton Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-object/m-p/2805580#M655585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fred,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you might want to consider using a GUID as the unique key for your objects. A GUID is a unique system wide ID. You can create each one using the function module GUID_CREATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also use this problem as an excuse to look at Shared Objects. The possibilities with Shared Objects are fantastic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Graham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Sep 2007 01:19:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-object/m-p/2805580#M655585</guid>
      <dc:creator>GrahamRobbo</dc:creator>
      <dc:date>2007-09-08T01:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Singleton Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-object/m-p/2805581#M655586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What you are doing here is as you've found out is to try and get round the limits of  using OO in a " Classic Relational Database" system. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When SAP starts using OBDBMS  (Object database system)  and can geuninely save objects as "persistent" in this type of database system then it probably can be done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However in the current SAP system  complex objects can only be built from data held in large numbers of different tables which may have a complex relationship  (by virtue of the RDBMS - relational data base system) so "Locking" this stuff system wide is not really (AFAIK) an option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A possibility is to use the JDO in JAVA where you can create genuine persistant objects which are held in a type of "OBDBMS" or Object data base management system as opposed to the traditional RDBMS (Relational model) that SAP uses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The JAVA JDO handles the actual SAP data base updates and maintains Data integrity between the JAVA object and the various SAP tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Classic ABAP currently isn't really geared to handle this yet. OO Abap is a HUGE improvement but still essentially limited by use of the underlying RDBMS (relational data base system) and (internal) SQL queries to retrieve the data from various tables when "constructing" / instantiating your object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Graham's suggestion seems to be the nearest you can get to answering this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However if anybody does have an answer to this I'll also be interested so please post on this thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2007 07:52:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-object/m-p/2805581#M655586</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-10T07:52:35Z</dc:date>
    </item>
  </channel>
</rss>

