Collection of non-persistent objects

Greetings
Is it possible to persist a Collection of non-persistent objects through the
kodo externalization feature? The non-persistent objects themselves are
externalizable, but I don't know how I would go about persisting a
Collection of them.
..droo.

If you store them in some sort of externalized form in a single column it is
easy - just use externalization framework to ext and de-ext them to anf from
string. Couple of caveats you need to be aware of If your collection objects
are mutable:
1. You need to durty your collection field so it get prsisted on commit
2. on rollback Kodo will restore you collection content but not collection
member content. If they are mutable you will have to make their class
persistent with mapping "none" so they participate in transaction
"Drew Lethbridge" <[email protected]> wrote in message
news:BD0B44BF.544%[email protected]..
Greetings
Is it possible to persist a Collection of non-persistent objects throughthe
kodo externalization feature? The non-persistent objects themselves are
externalizable, but I don't know how I would go about persisting a
Collection of them.
.droo.

Similar Messages

  • JSF + Hibernate - non- persistant objects in a dataTable

    This is more of a conceptual question, concerning creating a dataTable from a list.
    I have a User-with-Projects 1:M relationship. Projects are obligatory and not obligatory. I have a user with one compulsory project and a 5 not obligatory. The point is that the 6 projects should be visible in the UI under a h:dataTable component while each inputText from the dataTable should be mapped to beans. The obligatory project is always persisted in the DB, but the others are persisted only if data is inserted in the UI.
    So my question is:
    How could I form a dataTable, including the 6 project, and check if a data is inserted in the not-compulsory ones?
    I tried to create a User object with 6 Project entities (pojo classes), the first one is persisted in the DB and the others are not. This way I had a problem with the lack of ProjectID in the 5 remaining projects (since they are not a part of the DB). The issue could be elsewhere, but that's a rock I hit.
    I'll also try creating a ProjectBean with 6 project, on a form submit checking each of the rows for a new data. If user input is available, the project would be inserted in the table. I could also try using an actionListener to check for the input, but I'm not quite sure of getting the correct row I need when the listener is active.
    Is there any elegant way of mapping the projects and insert the not- obligatory only if they contain data?
    Thanks in advance,
    nofearinc

    >
    Straightforward enough: check if the values aren't null ;) You can also consider to add a valueChangeListener to one or more fields. It would only be fired if the field's value has been changed.
    Thanks for the comment, It was just weird for me how to have a User with a List<Project> and not all of the projects are persisted :) It seems a little strange for me as a realization and I assume that Hibernate would also be confused after session saving. That's why I think that I'll need a list of backing beans which would lately be transfered to entities if data is persisted (just being curious if there is more easy and elegant way to do that).
    The valueChangeListener would be called after any data is inserted in the row - it's possible that a user could go wrong and edit a field, then erase it again. So I have to insert in the DB only on a form submit (less DB activity).
    I'll try this getRowData() method tomorrow, it seems like a reasonable solution if I could use it in my case (dataTable with list of projects and get each row as a particular project).
    Thanks again for the reply, I'd be happy to hear any ideas on the subject ;)
    nofearinc

  • Single Persistent instance of a Object, Many non persistant. Same Identity on persist

    I have a persistent bean class with two Strings as member fields. (example
    below)
    I have many other classes that use it a part of they're member fields.
    I need to have only one persistant version of it (One row, to many Rows in
    different tables). But can have many non persistant versions. I can't
    control the creation of the non persistant objects.
    i.e.
    On persist, How can I configuration JDO to detect that it's the same as an
    object already in the database and use that instead?
    example:
    // Example class One
    package foo;
    public class One(){
    public String var1;
    public String var2;
    public String getVar1(){
    return this.var1;
    public void setVar1(String var1Set){
    this.var1 = var1Set
    public String getVar2(){
    return this.var2;
    public void setVar2(String var2Set){
    this.var2 = var2Set
    /// one.jdo
    <?xml version="1.0"?>
    <jdo>
    <package name="foo">
    <class name="One"/>
    </package>
    </jdo>
    ///Example Scenario
    One oneObject = new One();
    oneObject.setVar1("Value1");
    oneObject.setVar2("Value2");
    pm.makePersistent(oneObject); // one row in database
    /// Some time later, in a different thread, or since JVM shutdown and
    restart
    One oneObject = new One();
    oneObject.setVar1("Value1");
    oneObject.setVar2("Value2");
    pm.makePersistent(oneObject); // one row in database, instead of two.

    You cannot. You should either find the object by query or retrieve it
    using application identity.
    Graham Cruickshanks wrote:
    I have a persistent bean class with two Strings as member fields. (example
    below)
    I have many other classes that use it a part of they're member fields.
    I need to have only one persistant version of it (One row, to many Rows in
    different tables). But can have many non persistant versions. I can't
    control the creation of the non persistant objects.
    i.e.
    On persist, How can I configuration JDO to detect that it's the same as an
    object already in the database and use that instead?
    example:
    // Example class One
    package foo;
    public class One(){
    public String var1;
    public String var2;
    public String getVar1(){
    return this.var1;
    public void setVar1(String var1Set){
    this.var1 = var1Set
    public String getVar2(){
    return this.var2;
    public void setVar2(String var2Set){
    this.var2 = var2Set
    /// one.jdo
    <?xml version="1.0"?>
    <jdo>
    <package name="foo">
    <class name="One"/>
    </package>
    </jdo>
    ///Example Scenario
    One oneObject = new One();
    oneObject.setVar1("Value1");
    oneObject.setVar2("Value2");
    pm.makePersistent(oneObject); // one row in database
    /// Some time later, in a different thread, or since JVM shutdown and
    restart
    One oneObject = new One();
    oneObject.setVar1("Value1");
    oneObject.setVar2("Value2");
    pm.makePersistent(oneObject); // one row in database, instead of two.
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • Problem creating non-persistent Child Objects

    I have the need to create a non persistable child object in the
    jdoPreStore of a parent object. I then perform some tests on the parent
    to determine if the child object needs to be persisted or not. If I leave
    the child non persistent it still writes to the database.
    I was performing the follwoing piece of code
    Class Parent {
    // The relationship is a 0 to many
    public Child createChild() {
    Child child = .....//create non persistent object
    child.setParent(this);
    getChild().add(child);
    It appears that if I remove the getChild().add(child). It does not
    persist (as desired).
    Is this correct behaviour?? I dont think that it should be, but if it is
    then I have a further problem.
    If that child object inherits from another object and you remove the
    getChild().add(child) kodo outputs an invalid object to the database. It
    doesnt insert a row to the child table. But it inserts a row to the
    childs inherited object table. This is now an invalid object and will
    fail upon loading.
    Any help on this would be appreciated.
    Thanks
    Luke.

    JDO has something called persistence by reachability. This means that
    objects do not have to explicitly be marked as to be persistent as JDO
    will traverse the object graph to ensure that all nodes are persistent.
    I think you are seeing this behavior combined with another side
    behavior: Kodo requires that both sides of a relation be set.
    Basically, keep your objects in synch (set both sides of the relation).
    And if you want to hold onto a reference to non-persistent object
    before you decide what to do with it, add a transient field or a field
    marked "persistence-modifier="none"" in your metadata and then process
    those transient fields in jdoPreStore ().
    i.e.
    if (//businessLogic is true)
    persistentField = transientField;
    Luke wrote:
    I have the need to create a non persistable child object in the
    jdoPreStore of a parent object. I then perform some tests on the parent
    to determine if the child object needs to be persisted or not. If I leave
    the child non persistent it still writes to the database.
    I was performing the follwoing piece of code
    Class Parent {
    // The relationship is a 0 to many
    public Child createChild() {
    Child child = .....//create non persistent object
    child.setParent(this);
    getChild().add(child);
    It appears that if I remove the getChild().add(child). It does not
    persist (as desired).
    Is this correct behaviour?? I dont think that it should be, but if it is
    then I have a further problem.
    If that child object inherits from another object and you remove the
    getChild().add(child) kodo outputs an invalid object to the database. It
    doesnt insert a row to the child table. But it inserts a row to the
    childs inherited object table. This is now an invalid object and will
    fail upon loading.
    Any help on this would be appreciated.
    Thanks
    Luke.
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • Hashtable with persistent object as key and collection as value

    I am trying to use a Hastable with a persistent object as the key and a
    collection as the value. A long time ago, Abe White said:
    "Kodo currently does not support a map in which the keys are persistent
    objects and the values are collections. I think your best bet would be
    to create an intermediate class that has a 1-1 relation to the "key" and
    a collection of persistent objects for the "value". Then keep a
    collection of these intermediate objects. You could use jdoPostLoad and
    jdoPreStore to hash/unhash the collection of intermediate objects to/from
    a Map if you need to."
    So I made an intermediate class, which gave me a Hashtable with a persistent
    object as the key and another for the value. Then the one for the value
    contains the collection. This works but I'm wondering about the
    performance, would this method be slower?
    Also it was said that version 3.0 would support this. I'm curious if this
    is available in 2.5 or if it's still planned for 3.0.
    Thanks
    Michael

    I'm observing massive performance problems but I didn't think it could be
    caused by this intermediary object but maybe that is the problem. For
    example if I start a transaction to delete everything (with 3,000 records
    which in turn has 3,000 records which in turn has 2 lists each) theprogram
    crashes before it can finish the transaction. I then put in some loops to
    delete 100 records at a time and this runs but it took over an hour to
    delete the 3,000 records.
    Do you have any other ideas of how to improve the performance? Are there
    any alternatives?I solved the performance problem. I was storing web page content (all the
    HTML) in a String which by default is in the default-fetch-group. I had
    been thinking this was using lazy-loading but it wasn't. So I put
    default-fetch-group=false for this property and now the performance is
    great. It makes sense because it was retrieving approximately 5k of text
    for each record! When deleting 3,000 records this comes out to be 14 megs.
    Moral of the story: Use the default-fetch-group wisely!!

  • Updating non-persistent fields in an Entity Object

    Hi,
    I wanted to add a non-persistent field to an Entity Object to use as a temporary aggregate field for a detail entity. It appears that storing data in the field makes it look like the master entity has been updated even though the value cannot be saved in the data base. Is this the way it is supposed to work?
    I was trying to avoid putting invisible controls in the UI or creating "global" variables.
    Thanks,
    Peter

    This can be done with programmatic VOs: http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcadvvo.htm#sm0341
    Sample: http://blogs.oracle.com/smuenchadf/examples/#132
    You can also opt to do this with a simple Java class and a data control based on it.
    For example: http://blogs.oracle.com/shay/2009/07/java_class_data_control_and_ad.html

  • Can't use non persistent domains im Bc4j

    I tryed to create a new domain with the persistent option off (in my example it was String type).
    Then I selected one of my Entity Objects to add a new non-persistent property. When I select my created domain, it raises an nullpointer Excpetion.
    I'm using Jdev 3.1 under NT. It happens with any entity in any project that I create. Even if I close my project and reopen, it still happens.
    Only persistent domains are working in this realease ?
    Alexandre Torres

    At least, it looks like just an JDev bug. I writed by hand the new attribute in the XML file, and it works fine. But I can't use the edit option of the menu anymore to this Entity...
    this is the Xml definition
    <Attribute
    Name="ConteudoXml"
    IsQueriable="false"
    <!-- this sets as non persistent -->
    IsPersistent="false"
    <!-- the domain line and the type looks like redundant... --> Domain="com.dixtal.central.negocio.XmlDomain"
    Type="com.dixtal.central.negocio.XmlDomain"
    ColumnName="$none$"
    ColumnType="$none$" >
    <DesignTime>
    <Attr Name="_DisplaySize" Value="0" />
    </DesignTime>
    </Attribute>
    Expect this bug to be corrected in next version of the product

  • Non-persistent fields

    Hi,
    I would like to use toplink with objects that contains both persistent and non-persistent fields (unmapped). When I insert such an object to the database using unit-of-work, and then try to query toplink for that same object elsewhere in my program I only get the persistent fields. I've tried using checkCacheThanDatabase() which resolved the problem but this method is only available for ReadObjectQuery not for ReadAllQuery (the javadoc is not consistent with the code).
    My questions:
    1. For ReadObjectQuery, can I trust the cache to always have my object, or is there a risk that the cache will drop it?
    2. What to do with ReadAllQuery?
    3. Any other approach that can work?

    You can make non-persistent attributes remain with the object in a unit of work through using a clone policy and using the postMerge event.
    Your class needs to implement Cloneable and in the descriptor use clone-copy-policy. This will ensure that when a cached object is registered into the unit of work the non-persistent attributes will be maintained.
    When the unit of work merges a transactional object into the session cache you need to make sure you copy the non-persistent attributes from the clone to the cached object. You can do this through a DescriptorEventListener and the postMerge event.
    Example:
    postMerge(DescriptorEvent event) {
    String tempProperty = ((MyClass) event.getObject()).getProperty();
    ((MyClass) event.getOringalObject()).setProperty(tempProperty);
    Note that since the attribute is non-persistent it will not be guaranteed to persist indefinitely. The non-persistent attributes duration will be dependant on your caching policy, if it gets dropped from the cache, a new instance will be built from the database the next time it is accessed.
    The checkCacheThanDatabase checkCacheOnly properties should not have any effect on what you get from the cache. Reads that access the database will still maintain object identity with the cache, and you should get back the correct object.

  • Query vs Toplink managed collection and cascade persist

    A fairly simple situation: I have a 1-N relation which is managed by Toplink: 1 relation can have N calendars (I know, badly chosen class name, but alas).
    If I access the collection through the Toplink managed collection, make a change to one of the calendars and then merge the relation, the change in the calendar instance automatically is detected and also persisted.
    However, if I use a query (because I do not need all calendars) to find the same instance and make the same change, then it is not persisted. Appearantly the "cascade persist" is not done here.
    There are a few ways around this:
    1. fetch the original collection and by compare-and-remove emulate the query
    2. do a setRelation(null) and then setRelation(xxx) of the relation
    3. do a merge inside the transaction (a merge outside does not work)
    The funny thing is, workaround #2 really sets the same relation again!
    Is there a way to have the result of a query also cascade persist?

    Well, I do not want to do it in a transaction, because then the changes are written to the database immediately and that will result in all kind of locking problems (this is a fat client situation). What want is fairly simple: the user modifies entities in an object graph in memory and at the end of his work either presses "cancel" and clears all changes, or presses "save" and stores all changes. When he presses "save" I expect the EM to persist every changed entity.
    This approach works ok for all scenario's I have implemented up until now. The current one is different in that I get related entities not by traveling the object graph (so via Cascade.PERSIST collections), but via a query. There is one major difference between these two: the entities from the collections are automatically persisted, the ones from a query are not.. BUT they are -for all means and purposes- identical. Specifically: the collection gives me ALL calendars associated with the relation, the query only those from a timespan but still associated with the relation.
    For some reason I expected the entities to also auto-persist, BECAUSE they also are present in the collection.
    Ok then, so I understand that entities fetched through a query are unrelated to any other entity, even though they also exist in a Cascade.PERSIST collection. (I still have to test what happens if I, after the query, also access the collection: will the same object be present?)
    That being as it as, I need to merge each queries entity separate and thus I expect the EM to remember any entities merged outside a transaction, but it does not. That I do not understand.
    Now, I already have a patched / extended EM because of a strange behavior in the remove vs clear dynamics, so this was a minor add-on and works perfectly (so far ;-). But if you have a better idea how to remember changes to entities, which are to be merged upon transaction start... Please!

  • Need to cache non-persistent field value

    Is it possible to have a non-persistent field in PC class which value will be updated by app, stored in DataCache and then can be used when PC instance will be taken from DataCache next time?
    I tried to map my field as persistence-modifier="transactional" or "none". I do see in my log that the object is taken from cache, but that transient field value is always null after object retreival.
    Thanks, Denis.

    Thanks for the hint, Abe.
    I got what I need via custom filed mapping. If anyone interested:
    public class CacheFieldMapping extends ColumnFieldMapping {
    public CacheFieldMapping(FieldMetaData meta) {
    super(meta);
    public String getMappingType() {
    return getClass().getName();
    protected int getJDBCType() {
    return Types.OTHER;
    public boolean map() {
    return true;
    public void fromMappingInfo(MappingInfo info, boolean adapt) {
    // do nothing...
    public void toMappingInfo(MappingInfo info) {
    // do nothing...
    public void refSchemaComponents() {
    // do nothing...
    public int select(Select sel, KodoStateManager sm, JDBCStoreManager store,
    JDBCFetchConfiguration fetch, int eagerMode) {
    return -1;
    public void load(KodoStateManager sm, JDBCStoreManager store,
    JDBCFetchConfiguration fetch, Result res) throws SQLException {
    // do nothing...
    public void load(KodoStateManager sm, JDBCStoreManager store,
    JDBCFetchConfiguration fetch) throws SQLException {
    sm.storeObject(getIndex(), null);
    public Object loadProjection(JDBCStoreManager store,
    JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
    return null;
    public Boolean isCustomInsert(KodoStateManager sm) {
    return Boolean.TRUE;
    public Boolean isCustomUpdate(KodoStateManager sm) {
    return Boolean.TRUE;
    protected void update(KodoStateManager sm, Row row) throws SQLException {
    // do nothing...
    "Abe White" <[email protected]> wrote in message
    news:[email protected]..
    No, this is not possible. The data cache acts exactly like the
    database, only storing persistent values.

  • Marking a field as non-persistent?

    Hi folks,
    We've been building up a distributed data store that has a BDB at each leaf node. There are a few layers that our objects go through, and up until now we've been able to use our Entity objects directly throughout the code. They get serialized by RMI and make their way to our BDB nodes and get persisted by the DPL.
    But now we have a situation where we have a field that we want serialized (non-transient) so that it makes its way all the way through our system, but then not persistent when it reaches the DPL. (We also have a search index at each leaf, and this bit of data includes some instructions for the search engine.)
    The best solution (from my perspective!) would be simply to have an @NonPersistent annotation to make the DPL ignore a particular field. Lacking that, I came up with a couple options, neither of which I like. First, I could add a wrapper object that isn't an Entity class that contains my non-persistent data. I don't really like this idea, but it could work (makes all my objects a little larger and they get serialized a LOT). Second, I could modify readObject and writeObject to manually throw in the transient fields that I wanted to keep around. I don't really like that either (for different reasons), but it also could work.
    Any other thoughts? Is there anything I'm missing that would allow me to do this easily?
    Thanks!
    Jeff

    Hi Jeff,
    I think the addition of @NonPersistent is a reasonable request and probably the only good solution. One of the primary goals of the DPL is to be able to persist objects that are used in other ways -- RMI is a good example. In other words, the DPL intends to be a pure POJO persistence solution. However, we didn't consider the case of a field that is persistent with respect to RMI but not the DPL, or vice-versa. So I think solving this is important.
    Let us spend some time on that and we'll see if we can get this into a 3.3 dot release. This is a fairly simply addition, but we'll need to also consider the reverse situation -- a field that is persistent WRT the DPL but not RMI. In other words, we may need both @Persistent and @NonPersistent to apply to a field to override the default rules. And we'll need to encapsulate this information in the EntityModel abstraction so that it can be used without annotations.
    In the meantime, I suggest using one of the workarounds you mentioned, or perhaps even modifying the DPL source code in a way that works for you, temporarily.. If you choose the latter, note that there is only one place where field persistence is determined, which is in the getInstanceFields method of this class:
    src/com/sleepycat/persist/impl/FieldInfo.java
    See the call to Modifier.isTransient.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Defining non-Component objects with size and location using Swing

    I am attempting to write a program which will be able to manipulate (display, move, resize) objects in a Swing window which are not necessarily components. These "Window"s are defined by a Window interface which defines a Window as any object which has a size and a location (effectively a rectangular area). This would ideally allow me to perform operations such as drawing an arbitrary picture on a Jpanel, for example, wrap that drawing in a rectangular area, and then be able to resize it/move it about as a separate panel. In order to do this I believe I would have to override the paint() method, although I'm not completely sure. If anyone has any suggestions of a proper way to override the method or know a proper way to attack this problem, I would greatly appreciate it.
    Thanks,
    Adrian

    It's hard to say since it's not quite clear what you're doing but:
    1) if these objects are not necessarily components, that's fine, but you're not trying to add them to the basic GUI framework, are you? If you want to do something like this, then probably the best thing is to have a particular component that knows how to handle these objects, and then have a clean separation between components and non-components at that level. So this component would maintain and display a collection of those non-component objects, but no other component would be expected to know anything about them, and the non-component objects wouldn't know about any components at all.
    2) it might be helpful to give all the non-component objects a method that looks like this:
    void drawSelf(Graphics g);and that this method would tell the object to draw itself on that Graphics object. The object might also have an "offset" value, essentially an x,y position, and it would draw itself relative to that position.

  • Example of Serialized objects and non-Serialized objects

    Hi,
    Can you please tell me some of eample of Serialized objects and nonserialized objects in java and j2ee.
    Thanks
    alex.

    sravan123 wrote:
    Serialised objects are File ,all Collection classes , subclasses of Throwable and subclasses of Number.
    Non-Serialised objects are Connection,DataSourrce,Resultset , Thread and MathYou forgot to log in as another user before answering your own question incorrectly for reasons I'm currently unable to fathom

  • Exporting a PDF so that non-printing objects show but don't print?

    I've just spent a couple hours trying to find an answer to this in the forums, but can't. (The most frustrating was one thread where the original poster said, "I found the answer here," and gave a link that went right back to the main page of the forum. Argh.)
    Okay, anyway ... what I need to do?
    I've got a document with graphics that I want to show up on the pdf when I export it, but that--if a reader prints it--don't print.
    The document looks like a 3-ring binder with "tabs" for each section--just like the real thing. But the rings and tabs go right up to the edge and look terrible when printed, and whose printer can print right at the edge of the paper, anyway? But the tabs work as navigational links while looking a the pdf, and the rings just make it look cool, so I WANT them in the pdf.
    I've tried:
    Turning the entire layer into a non-printing layer (one that "shows" but does not "print"). But when I export it to a pdf, it doesn't show up on the pdf to look at OR to print. So that doesn't work.
    Using the Attribute option to turn each object into a non-printing object, but so far as I can tell, that doesn't do a thing, because they still print from the pdf.
    Exporting with the "create pdf layers" turned on and off. Exporting with the "include non-printing items" turned on and off.
    Basically, I've pretty much tried everything. I gather, from browsing the forums, that this is POSSIBLE, but can't for the life of me figure out what to do to make it happen. (Short of hiding the tabs' layer and creating an entirely separate PDF and calling it "Print version" which is not exactly what I want to do!)
    Is there maybe some magical combination of ons and offs I need to select to make this whole thing work?
    (And, seriously, am I the only person who thinks the supporting documentation is just dreadful? I can't find anything in any of the Help screens that even mentions this, much less explains how to do it.)
    Any help is appreciated!!
    --Deb

    Partial progress...
    The button option (and, I'm using CS3, by the way--I should have said that originally) does work in terms of showing on the pdf but not printing.
    The problem is that it messes up the way the document looks.
    I said it's designed to look like a 3-ring binder with tab-dividers between each section, and each tab has a hyperlink to take you to that section.
    Now, when you've got a paper binder in front of you, the tabs stay in the same sequence, and often overlap a bit (which mine do). The problem I'm having, having turned all of them into buttons, is that when you click on any of them, it "jumps" to the front of the row, so that they don't "flow" in the correct sequence.
    Am I explaining this well? You know, the top-most tab is at the top of the pile, the next one is always below it and above the third one, and so on ... you never see the second tab on TOP of the first one. I'm trying to get the document to act as close to a hard-copy binder as I can, and it did ... except the buttons keep jostling each other for attention...
    I'm going to go play around with this some more now, but ... any suggestions? (Other than restructuring my tabs so that they don't overlap at all?)

  • How can i get the unitOfWork or the persisting object in to my listener???.

    hi,
    i have a listener class which extends SessionEventAdapter ....as shown below
    public class MyLister extends SessionEventAdapter{
    public void postCommitUnitOfWork(SessionEvent event) {
    System.out.println("POST COMMIT OF WORK");
    // How can i get the unitOfWork or the persisting object in to my listener???
    Another class makes use of this listener by adding the listener into a getEventManager() of a session ....
    public final class AetbProcessStatusClient {
    public static final void main(String[] args)
    {  Project project =   
    XMLProjectReader.read("META- INF/AetbProcessStatus.xml",
    Thread.currentThread().getContextClassLoader());
    DatabaseSession session = project.createDatabaseSession();
    MyLister myListener = new MyLister();
    session.getEventManager().addListener(myListener);
    session.login();
    UnitOfWork uow = session.acquireUnitOfWork();
    uow = session.acquireUnitOfWork();
    Vector vec =
    (Vector)uow.executeQuery("SQFunctionIdProcessStatus", AetbProcessStatus.class);
    AetbProcessStatus processStatus = new AetbProcessStatus();
    processStatus = (AetbProcessStatus)vec.get(0);
    processStatus.setRunStat('E');
    processStatus.setProgramSeqNo(10);
    uow.commit();
    now my question --> How can i get the unitOfWork or the persisting object in to my listener???....
    ie the object "processStatus" into my listener

    The SessionEvent's session (getSession()), should be the UnitOfWork. You can access the UnitOfWork or UnitOfWorkImpl methods to access the objects in the unit of work. getUnitOfWorkChangeSet() will return the changes made in the UnitOfWork.
    -- James : http://www.eclipselink.org

Maybe you are looking for

  • Problem dragging keyword tags in LR 3

    Hi, I am helping a user who has many keywords in Lightroom (hundreds). He usually tags images with keywords by dragging a keyword tag from the Keyword Tags panel onto an image in the grid. But the last 32 tags are not working. When he clicks on one o

  • Can bussiness logics been added to a middleware?

    Hey, Could any one help me understanding the below query? 1. Heard that Middleware should play a role of get and put or tranforming messages between various applications? 2. Bussiness logics can be added to a middleware application? If so, is it not

  • Serial Port Interface

    Please excuse me, as I am a EE student and all this Java is new to me. I am obtaining information via a TI MSP430F449 board and wish to transfer this data to my PC via the serial port. I have been told that Java is the way to go to to do this. I woul

  • CS3 Compatibility Issue

    I've been working on a couple of documents in InDesign CS5 (trial version) and trying to transfer them to a version of InDesign CS3 that I use elsewhere but there are compatibility issues.  Is there some way I can save my files as an idx file because

  • Anyone else have their cc hacked after purchasing an iPhone?

    My husband and I bought iPhones about a month ago, each using our own credit cards to make the purchases. Now within two days of each other our credit cards were hacked. When it happened to me over the weekend, I didn't think much of it. But now that