Transient fields in Path2d

Hello
Path2D and its subclasses seem to be the only ones of *2D classes in java.awt.geom, that have non-public, transient fields. Is there a special reason for this? And is this to be interpreted that persistence frameworks should not support these classes?

Hi all,
I've been playing around with the reflection API for
introspecting various members of the Collection
Framework (CF).
It turns out that many of the fields used by the
members of the CF use the transient fields for
their data-storage. For example: ArrayLists stored
their elements in a transient field named
elementData.
Following the Java Language Specification, the
transient fields are therefore not part of the
object's persistent state. As a consequence, it is
"not" possible to make such an object persistent
(although, from what I understood, you could serialize
such an object including its element data).
Is there any particular reason why those fields are
defined as transient?You need to distinguish between the data logically contained by a Collections object (or indeed any other), and how that data is represented both in memory, and in the persisted form. A class marks a field transient simply to inform the default serialization mechanism that the field does not form part of the persistent representation. Typically this is either because it is only used for cacheing purposes, or because the class itself takes responsibility for the persisted form.
The Collections classes often have a complexity in their memory representation that is related to their performance requirements, but which serves no purpose in their persisted form. Consider a TreeMap, for example. Its memory representation involves a tree, but the only things that need to be persisted are the key/value pairs. Persisting the tree would be wasteful in both time and peristent storage.
Sylvia.

Similar Messages

  • Aggregate value of a transient field is not updated from cache

    Hello together,
    A view object has a transient field which display the count of records from a view accessor. In the EO for the view object ( of the view accessor) opearations on rows are perfomed from a different view object, this changes are not reflected in the transient field value.
    I know is not very clear,here is sample:
    Woker VO
    -Worker EO
    Worker2Department VO
    -Worker2Department EO
    Department VO
    -Deparment EO
    -workerCount: WorkersCounterViewAccesor.count("WorkerID")
    WorkerCounter VO
    -Worker EO
    -Worker2Department EO
    attribute binding: DepartmentID
    If from Worker2Department records are deleted or inserted, the value of workerCount is not updated.
    I've try to executeQuery on each view object,without success. I've notice that the WorkerCounter VO is having always the same records count after Worker2Department VO is updated.
    If the method getDBTransaction().postChanges() is invoked, then the data is correctly fetched but then there are different other problems, and i would like to avoid using of postChanges().
    My question is: why when rows are inserted/removes into/from a view object the changes are not visibile on different view objects declared for the same entiy object? Or how to make sure that the changes from an entity object are reflected in each view object that are using it?
    Thank you a lot,
    Bogdan

    Hi,
    If you place the 0WBS_ELM_EX  in the ODS ,either in the key field or in the data field , you can find it as a charecteristic in the report and you can drag it into the rows.
    To reflet the changes that you made to the masterdata , you need to run the attribute change run every time you load the data .
    regards,
    haritha

  • Use of transient fields in Collections Framework?

    Hi all,
    I've been playing around with the reflection API for introspecting various members of the Collection Framework (CF).
    It turns out that many of the fields used by the members of the CF use the transient fields for their data-storage. For example: ArrayLists stored their elements in a transient field named elementData.
    Following the Java Language Specification, the transient fields are therefore not part of the object's persistent state. As a consequence, it is "not" possible to make such an object persistent (although, from what I understood, you could serialize such an object including its element data).
    Is there any particular reason why those fields are defined as transient?

    Hi all,
    I've been playing around with the reflection API for
    introspecting various members of the Collection
    Framework (CF).
    It turns out that many of the fields used by the
    members of the CF use the transient fields for
    their data-storage. For example: ArrayLists stored
    their elements in a transient field named
    elementData.
    Following the Java Language Specification, the
    transient fields are therefore not part of the
    object's persistent state. As a consequence, it is
    "not" possible to make such an object persistent
    (although, from what I understood, you could serialize
    such an object including its element data).
    Is there any particular reason why those fields are
    defined as transient?You need to distinguish between the data logically contained by a Collections object (or indeed any other), and how that data is represented both in memory, and in the persisted form. A class marks a field transient simply to inform the default serialization mechanism that the field does not form part of the persistent representation. Typically this is either because it is only used for cacheing purposes, or because the class itself takes responsibility for the persisted form.
    The Collections classes often have a complexity in their memory representation that is related to their performance requirements, but which serves no purpose in their persisted form. Consider a TreeMap, for example. Its memory representation involves a tree, but the only things that need to be persisted are the key/value pairs. Persisting the tree would be wasteful in both time and peristent storage.
    Sylvia.

  • View Criteria and Transient fields

    Hello, I was wondering, is it possible to have View Criteria set on a Transient field? I have created a Transient field named "Field1". I then go to the Query tab in my ViewObject and select the option "Create new view criteria". Here I select the option "Add Item" and from Attribute list I select my field "Field1". However what I notice is that the "View Object Where Clause" does not get updated when the attribute I select is a transient field - when it is a normal field (i.e. from an Entity) it does get updated. This means that I am unable to create view criteria for transient fields. Is there a way how I can manage to do this?

    Transient attributes are not based on database columns. This means that WHERE-clause on transient attributes is a non-sense. It makes sense to add conditions on transient attributes only if the view criteria will be executed as a filter in memory (see the "Query Execution Mode" property in the "Create View Criteria" dialog).

  • Can Transactional Transient fields be modified outside of transaction in jdoPostLoad?

    It is not clear from specs whether Transactional Transient fields be
    modified in jdoPostLoad. The specs state "Non-persistent fields whose value
    depends on values of default fetch group fields should be initialized in
    this method". However it can't be done for Transactional Transient (which
    are Non-persistent ) fields outside of transaction. Often those
    "Non-persistent fields whose value depends on values of default fetch group
    fields" should be transactional but they can't as there is no way they can
    be initialized in jdoPostLoad()
    From specs:
    10.1 jdoPostLoad
    public void jdoPostLoad();
    This method is called after the default fetch group values have been loaded
    from the StateManager into the instance. Non-persistent fields whose value
    depends on values of default fetch group fields should be initialized in
    this method. This method is not modified by the enhancer. Only fields that
    are in the default fetch group should be accessed by this method, as other
    fields are not guaranteed to be initialized. This method might register the
    instance with other objects in the runtime environment.
    The context in which this call is made does not allow access to other
    persistent JDO in-stances.

    Right now Kodo allows modification to Transactional Transient fields outside
    of transaction. However it would throw an exception if I attemp to modify a
    collection which is declared as Transactional Transient
    "Alex Roytman" <[email protected]> wrote in message
    news:b3bsta$13f$[email protected]..
    It is not clear from specs whether Transactional Transient fields be
    modified in jdoPostLoad. The specs state "Non-persistent fields whosevalue
    depends on values of default fetch group fields should be initialized in
    this method". However it can't be done for Transactional Transient (which
    are Non-persistent ) fields outside of transaction. Often those
    "Non-persistent fields whose value depends on values of default fetchgroup
    fields" should be transactional but they can't as there is no way theycan
    be initialized in jdoPostLoad()
    From specs:
    10.1 jdoPostLoad
    public void jdoPostLoad();
    This method is called after the default fetch group values have beenloaded
    from the StateManager into the instance. Non-persistent fields whose value
    depends on values of default fetch group fields should be initialized in
    this method. This method is not modified by the enhancer. Only fields that
    are in the default fetch group should be accessed by this method, as other
    fields are not guaranteed to be initialized. This method might registerthe
    instance with other objects in the runtime environment.
    The context in which this call is made does not allow access to other
    persistent JDO in-stances.

  • Transient fields disappear from my screen

    Hello, I hope someone can help me.
    I have a problem with transient fields.
    After being captured by more than an hour indicate null values
    I tried the suggestion of "djazia"
    "Hello
    If losing your data transient After 10 mins, I guess you attribute your Have not tagged as "passivated".
    Or you can do it at Tuning Into VO level, check state and passivated "including transient All Values" id you want to keep all transient data.
    This is due to pooling AM .. check the doc for more Understanding
    Jack "
    but did not work. The problem persists.
    Any other suggestions??
    Note: I am using the component af: forEach in JDeveloper 10.1.3.3 to display values on screen
    Greetings!
    Edited by: damacelo on Sep 12, 2011 8:49 AM

    Try a reset. Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo. Ignore the red slider.

  • Weird? Externalizing writes out transient fields automatically...

    Essentially, I made up some class implementing Externalizable - with empty write/readExternal methods. Some how, the transient field have been writtena dnread back. From the stuff I''ve read about this, nothing mentions externalizable overriding the "don't write transient fields behaviour". The weird thing is: externalizable is supposed be when you need to say explicitly how to write your object (field by field for e.g.). When I ran this, I got all the fields written and read...
    import java.io.*;
    public class SerializationExample {
         public static void main(String[] args) {
              try {
                   ToBeWritten tbw = new ToBeWritten();
                   FileOutputStream f_out = new FileOutputStream("test");
                   ObjectOutputStream out = new ObjectOutputStream(f_out);
                   out.writeObject(tbw);
                   out.close();
                   FileInputStream f_in = new FileInputStream("test");
                   ObjectInputStream in = new ObjectInputStream(f_in);
                   ToBeWritten tbr = (ToBeWritten) in.readObject();
                   in.close();
                   System.out.println(tbr.privateField);
                   System.out.println(tbr.staticField);
                   System.out.println(tbr.transientField);
              } catch (Exception e) {
                   System.out.println(e);
         static class ToBeWritten implements Externalizable {
              private String staticField = "staticField";
              transient String transientField = "transientField";
              private String privateField = "privateField";
              public void writeExternal(ObjectOutput out) throws IOException {
              public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
              public ToBeWritten() {
    }

    ejp, you description is more accurate.
    Technically, the serialization code creates an new constructor for the class which calls the first non serializable super class's no-arg constructor method, provided that constructor is public, protected or (package-private and in the same package as the class)
    If the first non-serializable no-args contructor is not accessible, an InvalidClassException is thrown.
    As ejp points out, it is more complex than most author would suggest.
    @see code for java.io.ObjectStreamClass.getSerializableConstructor(Class)

  • Serializing final transient fields

    I have some fields that I want to explicitly set when my deserialized object is constructed. These are transient final fields, so they are not set by the default deserialization process. Nor am I able to assign to a final field from within the readObject() method.
    What can I do to run some custom construction code during deserialization?

    The short and harsh answer is that you can't initialize a final transient field when deserializing. As you probably know, deserializing doesn't call any constuctor, and thus no in-place initializers are called.
    However.
    If your Serializable class has a non-Serializable base class with a no-arg constructor, the base class part of your object is not deserialized; it is default constructed and the class initializers are called. So, if you create a non-serializable base class with a no-arg constructor and put your final transient fields there, they will be initialized with their non-default value. Be aware that if you do declare your base class to implement Serializable, it will be restored by deserialization instead of construction and again no initializers are called.
    This article contains a lot of information on serialization and transient; it doesn't deal with final transient fields (so its solution doesn't apply to your problem) but it did give me the idea outlined above.
    http://www.javaworld.com/javaworld/jw-04-1998/jw-04-beans.html

  • Date Picker based on transient field

    Hi,
    JDev 10.1.3, ADF, BC4J:
    I have a jsp with two date fields that I use for searching. I have created a form bean that stores these fields as java.sql.Date types, and also generated a data control from this form bean.
    The problem is, I want to display these fields as date pickers in my browser.
    If I have a data-bound date field I can just drag it on to the page and select to drop it as type "Input render". This will create the date picker for me.
    However, if I do the same thing with my non-data-bound dates, they do not appear on the resulting page.
    Is there a way of creating date pickers based on transient (non-data-bound) fields?
    Cheers,
    Alex.

    Field validation assumes that the field being validated is to the left of the operator in the syntax. Since your validation requirement is complex, you would use the IIf statement.
    This is the syntax you should use for the Status field:
    =IIf((FieldValue('&lt;Status&gt;') = 'Commit' AND &#91;&lt;ClosedDate&gt;&#93; &gt; Today() + 90) OR (FieldValue('&lt;Status&gt;') &lt;&gt; 'Commit'),&#91;&lt;Status&gt;&#93;,"Invalid")
    You would build the syntax for Closed Date similarly. You would want to place this on all the affected fields to ensure it is called at the appropriate time. You should also test that it runs as expected when you edit other fields as well. This is another thread that talks about this issue: Re: Contact Field Validation (Email, Work Phone #, Mobile Phone #)
    Good Luck,
    Thom

  • ADF - view link join on transient field

    I have created two view objects (master, detail). The master table has a transient attribute which I wish to use as part of the join with the detail record.
    Any takers on how this might be done?
    As an alternative approach, instead of using a join on the transient attribute, I set the where clause of the detail record prior to calling super.executeImpl(actionContext) - should this work?
    Are there any 'detailed specs' on the ADF life cycle? The jdeveloper help doesn't provide much insight into this.
    Thanks

    from the component palatte drag n drop this component into your jsf page.
    more info:
    http://download.oracle.com/docs/cd/E15051_01/apirefs.1111/e12419/tagdoc/af_statusIndicator.html
    Using javascript you can change the mouse cursor to an hourglass. Try using clientListener within commandButton and use javascript.
    document.body.style.cursor = "wait";
    document.body.style.cursor = "default";
    Edited by: Puthanampatti on Jan 12, 2010 1:56 PM

  • Transient persestant memory-begin abort transaction-arraycopynonatomic

    If array defined as transient, then abort doesnt make any sense, chages are not rolled back.(Both for arrayCopy and arraycopyNonAtomic functions)
         public void AtomicNonatomic()
    byte hello[] = {'H','E','L','L','O'};
              byte[] key_buffer = JCSystem.makeTransientByteArray((byte)16, JCSystem.CLEAR_ON_RESET);
              //byte[] key_buffer = new byte[16];
              JCSystem.beginTransaction();
              //Util.arrayCopy(hello, (short)0, key_buffer, (short)0, (short)5);
              Util.arrayCopyNonAtomic(hello,(short)0, key_buffer, (short)0, (short)5);
              for(byte i =0; i<2; i++)
              key_buffer=0; //This types of assigning values are atomic operations, so can be thougth as arrayCopy
              JCSystem.abortTransaction();          
    If array not defined as transient and if arrayCopy is used then abort works
    If array not defined as transient and if arrayCopyNonatomic is used then abort not works
         public void AtomicNonatomic()
              //byte[] key_buffer = JCSystem.makeTransientByteArray((byte)16, JCSystem.CLEAR_ON_RESET);
              byte[] key_buffer = new byte[16];
              JCSystem.beginTransaction();
              //Util.arrayCopy(hello, (short)0, key_buffer, (short)0, (short)5);
              Util.arrayCopyNonAtomic(hello,(short)0, key_buffer, (short)0, (short)5);
              for(byte i =0; i<2; i++)
              key_buffer[i]=0;
              JCSystem.abortTransaction();          
    As a result begin-abort-commit should be used with non-transient arrays and without arrayCopyNonatomic function.
    Edited by: simeranya_00 on Aug 7, 2010 6:51 AM
    Edited by: simeranya_00 on Aug 7, 2010 6:56 AM

    Check out JCRE specification. Therein you will find what is (not) part of a transaction.
    1. All global arrays are not part of a transaction
    2. All transient fields/arrays/keys are not part of a transaction
    3. OwnerPIN object is not part of a transaction
    4. All Java Card API methods are transactional, except arrayCopyNonAtomic and arrayFillNonAtomic
    Lifetime of a transaction
    begin <--> commit
    begin <--> abort < -- rollback
    begin <--> JCRE context (process method exit) < -- abort transaction (done by JCRE) < -- rollback
    begin <--> uncaught exception < -- abort < -- rollback
    begin <--> tear/reset < -- rollback

  • How to model parent child relationship with DPL? @Transient?

    Hello All,
    I want to model a parent entity object with a collection of child entities:
    @Entity
    public class Parent{
    @PrimaryKey
    String uuid;
    List&lt;Child&gt; children;
    @Entity
    public class Child{
    @PrimaryKey
    String id;
    I know that the DPL won't support automatic persistence where it'll recursively go through my parent bean and persist my children with one call. Is there a way of applying the equivalent to JPA's @Transient annotation on "children" so I can persist the children manually and have the engine ignore the collection?
    If not and I want to return to the user a Parent with a List named "children," do I have to create a new object which is identical to Parent, but doesn't have the BDB annotations and manually assemble everything? If possible, I'd like to avoid defining redundant objects.
    Thanks in advance,
    Steven
    Harvard Children's Hospital Informatics Program
    Edited by: JavaGeek_Boston on Oct 29, 2008 2:22 PM

    Hi Steven,
    The definition of persistence is here:
    http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/model/Entity.html
    And includes this: "All non-transient instance fields of an entity class, as well as its superclasses and subclasses, are persistent. static and transient fields are not persistent."
    So you can use the Java transient keyword. If that isn't practical because you're using transient in a different way for Java serialization, see the JE @NotPersistent annotation.
    In general a parent-child relationship between entities is implemented almost as you've described, but with a parentId secondary key in the Child to index all children by their parent. This enables a fast lookup of children by their parent ID.
    I suggest looking at this javadoc:
    http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/SecondaryIndex.html
    as it describes all types of entity relationships and the trade-offs involved. The department-employee relationship in these examples is a parent-child relationship.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Mapping with transient filed

    Hello,
    how can a transient field get "offerlistsize" a value of subquery "select count(*) from OFFER o where o.REQUEST_ID = rr.ID" from db?
    Entity Bean
    RawRequest.java
    @SqlResultSetMapping(name="GetOfferSize", entities={
            @EntityResult(entityClass=de.kirchedlau.ponte.ejb.entities.RawRequest.class, fields = {
                @FieldResult(name="offerListSize", column="offerlistsize"),
                @FieldResult(name="id", column="ID"),
                @FieldResult(name="changeLog", column="CHANGE_LOG"),
    @Entity
    @Table(name = "RAW_REQUEST")
    public class RawRequest implements Serializable {
        @Id
        @GeneratedValue
        private long id;
        @Column(name = "CHANGE_LOG")
        private String changeLog;
        @Transient
        private int offerListSize;Session Bean
    RequestBean.java
    @Stateless
    public class RequestBean implements RequestInterface {
        public List<RawRequest> getRawRequestsList() {
            List<RawRequest> reqList = new LinkedList<RawRequest>();
                Query query = manager.createNativeQuery("select distinct * , (select count(*) from OFFER o where o.REQUEST_ID = rr.ID) as offerlistsize from RAW_REQUEST rr ","GetOfferSize");
                reqList.addAll((Collection<RawRequest>) query.getResultList());
                            return reqList;
    }

    I take it you tried it and the transient one is the only one that didn't get populated?
    Helps to know if you tried it and what results you got.
    The [API specs|http://java.sun.com/javaee/5/docs/api/javax/persistence/FieldResult.html] say the name is the "Name of the *persistent* field or property of the class." so that might explain it.

  • Setting field value from antother field

    I am having problems setting the value of a field depending on the entry of a previous drop down field.
    I am creating some wizard pages. On one page i wish a drop down list to populate another field. The drop downlist is unbound. (I have tried doing this with bound field aswell). To do this I have the Depends on Item of the target field to depend on the dropdown list field, so that the appropriate values are updated. (i have tried with the target field being bound and unbound aswell not that it should matter).
    I have then updated the VO (view object) adding transient fields when the fields are unbound. Then i updated the view row class. The setter of the drop down field was used to set the value of the target field. (Using the setter of target field). I added system.out.println and the fields are called and set accordingly. ie getters and setters are correct.
    However when i run the screens the target field value is not set with the value within the getter of target field.
    Could you advice if this is a bug or whether i should be coding this in a different manner. (if it is a bug and you tell me when it is likely to be fixed and any alternative work arounds).
    Cheers
    Alan

    Alan,
    Not really a bug, but "missing functionality". The problem is that ADF Faces will only refresh a UI Component value from the underlying model binding value when you submit the request with immediate="false", OR when you explicitly call resetValue() on the component.
    We have added a new boolean item-level property "Clear/Refresh Item When Depends-On-Item Changes" in the latest build.That property will do the trick for you: it will clear the value and call resetValue on the UI Components of the dependent items, BEFORE the depends-on-item model value is updated. So, in your case, the setter method of your depends-on-item attribute will update your dependent item after JHS cleared the item, and you will see the new value right away because UIComponent.resetValue() was called as well.
    Steven Davelaar,
    JHeadstart Team.

  • Treetable with transient attributes

    Hi,
    I use JDeveloper 11.1.1.2.0 to develope an ADF application.
    I need to create and show two level treetable using viewobjects theese have only transient fields.
    I have two viewobjects and a viewlink described below:
    1. VO : AccountsVO
    2. VO : ProductsVO
    Viewlink : ProductsOfAccountVL
    An account can has a lot of products. Both of viewobjects have only transient attributes.
    I have to use transient attributes because of the architecture of the application.
    I create and insert the rows to the viewobjects in managed bean.
    I need to create a treetable like below :
    AccountName1 AccountDesc1
    ---ProductNo1 ProductName1 ProductDesc1
    ---ProductNo2 ProductName2 ProductDesc2
    AccountName2 AccountDesc2
    ---ProductNo3 ProductName3 ProductDesc3
    When I drag and drop the parent VO as an ADF Tree Table then run the application, I could see only first level records.
    I mean only Accounts are shown.
    The viewlink doesn't work. Is this a bug or is it normally work like this.
    Finally I intend to create and add child node programmatically, but I don't know is it possible or not and how could it be done.
    What do you advice or what is the correct way.
    Mehmet
    Thanks.
    Edited by: mdoldur on 03.Haz.2010 12:33

    Hi Frank,
    I don't have any entity object, so I get the informations from a few different modules and
    insert them to the programmatic viewobjects which have transient attributes.
    In fact I could create 2 temporary tables on the database but I am not allowed to change the database schema.
    By the way I have updated my JDeveloper from 11.1.1.2 to 11.1.1.3 I will try the same operation and inform you.
    Thanks.
    Mehmet.

Maybe you are looking for

  • Ticket Saved without asking any confermation

    hi, i have a issue in web client. In ICWC if an agent created a follow-up activity by mistake and now click on the 'END' button. System automatically saved the ticket and didnt ask for any confirmation for it. In this thread Service Ticket and "End"

  • The view 'cpdpopupeditactionsview' does not exist.

    I just installed UCM without any issues as far as I could see, but when I log in as sysadmin at http://localhost/idc/ I always get a popup box saying: "The view 'cpdpopupeditactionsview' does not exist." Looking for the cpdpopupeditactionsview string

  • Does entourage 2008 solve all the new 10.6.3 ical syncing issues?

    I am keeping a running list of known issues with entourage and ical after the 'upgrade' from 10.4 to 10.6.3 OS. I have had two duplicated entourage ical calendars, time shift of events and now lastly, when i went to sync at 11pm last night, entourage

  • Response code 403 from server when launching jnlp

    Ive searched the forums for this same problem to no avail. We have a reverse proxy server which requires authentication to log in. Once the user logs in, then they can run our webstart app. But when I run it, I get this error in webstart: Please pay

  • Login/password_expiration_time

    is there a exception table for user, who should keep the password longer ?