How can I use the database default time rather than Java supplied time

I've searched over and over and nobody seems to have this issue so maybe its just me!
When inserting a record I would like the a create_date column to automatically use the database time rather than a supplied time via JPA. That was all times a relative to the database which makes sense.
The trouble is I cant figure out how to do this in a sensible manor.
If I specify an column like :
     @Temporal(TemporalType.TIMESTAMP)
     @Column(name = "CREATE_DATE")
     private Date createDate;
and IDL
CREATE_DATE TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_DATE NOT NULL
If I leave createDate null I get an exception. If modify the column to allow Nullable then column is set as Null.
If I leave the column out of the entity bean and then and create a row then the database current time is inserted. The trouble then is that if I want to read the date I'm going to have to create a copy of the bean but with the CREATE_DATE in it, and this doesn't make sense.

I should also mention that TopLink has always supported the ability to retrieve the current time from the database for use in optimistic locking. The TimestampLockingPolicy offers the ability to configure the next value being retrieved from the database instead of using the local time from the JVM. Our extended optimistic locking configuration does not currently support setting this option but it could be done using a descriptor customizer which can be configured in your persistence unit properties.
Using optimistic locking may be a good solution for the last modified date since it will also ensure that you do not corrupt the database if someone else has incremented this value since your last read.
Doug

Similar Messages

  • How can I use the RMS.vi over more than one period?

    Hi everyone,
    I am using the Cycle average and RMS.VI to get the RMS value of a alternative voltage (2kHz). To acquire this signal I am using a differentiel AI of a 6225 card (at 250kS/s) and the RMS value is correct, it works fine. However from what I have understood, this VI calculates the RMS value according to only one period no matter how many samples I have acquired (2000 samples in the VI I have attached). Is this correct? If so, is ithere a way to use it over all of the 2000 samples to get a more averaged value? Or does another VI exist?
    I could repeat several time an acquisition of a short number of samples (a period) and make an average but it would take some time and I have to do this with 39 other Inputs on the same card one after the other...
    Thank you for your help,
    User
    Attachments:
    Forum.vi ‏76 KB

    User_1979 wrote:
    ....could you tell me if this VI sends a rms value of X compleat periods (even if I have send X periods and a half for example)?
    It gives the RMS value of only the newest set of data.
    The RMS and RMS Pt. By Pt. work for me, but it depends on how you break out that Dynamic Data from the Express VI, which was why I suggested you didn't use it - mainly because you can't tell what happens to that data when you wire it to a function and it coerces. Actually, I should say, I can't tell what happens to it. You may know, but I don't.  
    In the attached screenshot, I have "made" a 2k sine wave with an amplitude of 5. The indicators show RMS value.
    Richard
    Attachments:
    rms.gif ‏14 KB

  • How can i use the database in my plug-in?

    Hi :
           I write a plug-in, but i want it can read the datafile and get the data of corresponding column ,at last show them on the pageitem. I know InDesign have this founction but i can`t get use it in my plug-in. ( * -- * ) !

    In my case, windows environment.
    I  use odbc c++ programming.
    odbc library.
    http://web1.codeproject.com/KB/database/caaodbcclass.aspx?msg=733173
    this code has some bug, but you can fixed it.
    Lion,J

  • How can I use the built-in Isight camera with an external camera (usb/firewire) at the same time?

    How can I use the built-in Isight camera and an external video camera at the same time?
    I'm wanting to stream over Oovoo/Skype/etc. using 2 cameras.
    Thanks

    Simple question with a not so simple answer.
    (a) If you mean that you want to run multiple apps simultaneously using a different camera with each app, you may encounter computing power limitations.  Digital video is processor intensive.  The only way to know if your Mac can do this it to try it.  If the video does not work together but each app works when it it the only app running, you are likely overloading your Mac's ability to process and/or move all the required data in your data bus.  You can get a better indication of whether this is the case by watching your Activity Monitor utility while running the apps you want to use.
    (b) If you mean that you want to have more than one compatible camera connected to your Mac simultaneously for ease of changing between video sources, some, but not necessarily all, apps you are using to operate your camera(s) allow you to select between your cameras.
    How you select among connected cameras depends on which application you are using. Here is how camera selection works in a few examples:
    (1) For iChat, you can choose which iSight you use in the "Camera:" choices bar in iChat > Preferences... > Audio/Video that appears when more than one compatible camera is connected. Although your camera choices will be different, the choices bar will look something similar to the Preferences settings shown here:
    If you cannot see the "Camera" choices bar, your Mac is recognizing only one (or none) of your cameras. In that case, consider the suggestions fromhttp://support.apple.com/kb/HT2090 for iSight problems or refer to your other camera's documentation for help.
    This particular choices bar solution applies ONLY to iChat. Most other applications also have settings that allow you to choose which camera to use. However, they do not all work the same way.
    (2) For instance, iMovie HD's camera choice is NOT set via Preferences. When you have more than one compatible camera connected, iMovie6 HD uses a drop-down menu choice something like this (depending on which version of iMovie you use):
    Note: Because I had no built-in iSight connected when I made this example, and because my external iSight was not connected, the drop-down menu showed only "Time Lapse." Because your Mac has a built-in iSight, your built-in iSight would show in the drop-down menu even when no other camera is connected. Connecting an additional Mac compatible webcam should allow you to choose either camera.
    Other iMovie versions work slightly differently.
    iMovie 9 (from iLife '11) uses a different camera choice button shown in this article:
      http://docs.info.apple.com/article.html?path=iMovie/9.0/en/mov39f84285.html
    iMovie 8 (from iLife '09) is slightly different as explained in this article:
      http://docs.info.apple.com/article.html?path=iMovie/8.0/en/10172.html
    In general, you can use your Mac's help for the application in use to find out how to select among more than one connected camera.
    (3) Photo Booth in Snow Leopard 10.6.x and later uses the Photo Booth > Camera menu command to select which camera to use.
    Note for readers with older Mac OS X: The previous version of Photo Booth that came with Tiger (10.4.x) is such a simple, basic app that it offers no menu selectable choice. Unless your built-in iSight is already occupied as the camera being used by some open application before you launch Photo Booth, Photo Booth will use ONLY your built-in iSight.
    However, you can use the trick from ¶ 4 of http://docs.info.apple.com/article.html?artnum=302781 to let Photo Booth use an external camera.
    (If you have an external Firewire camera connected, it may be used in preference to any USB webcam. If that is a problem for you, merely disconnect the problem Firewire device.)
    (4) For FaceTime, launch the app and click the Video menu item.
    If your Mac recognizes more than one connected compatible camera, a "Camera" section listing the cameras from which you can choose will appear there. Clicking on the desired camera name will let you select the one you want as shown in this image from my Mac Pro and LED Cinema Display:
    If your Mac recognizes only one compatible camera, the "Camera" section will not appear in the Video menu, but FaceTime will automatically use the connected camera that is recognized by OS X.
    (5) I do not use Skype oir Oovoo.  For those or other apps, see Help for each app for info on how to select your desired camera.
    Message was edited by: EZ Jim

  • How can i use the airport time capsule as a external hard drive?

    how can i use the airport time capsule as a external hard drive?

    Why do you recommend not place things like iTunes libraries or photo libraries on the drive? It was what I am looking for...
    I suggest that you ask the experts over in the iPhoto Support Community about their opinions on placing an iPhoto or Aperture library on the Time Capsule....even if you plan to use a wired connection for your Mac and the Time Capsule.
    But, if Terrence Devlin answers, be prepared for a lecture about why you should not ever do this.
    If you place the iTunes library on the Time Capsule, be prepared for iTunes to give you messages about not being able to find the library.
    In addtion, LaPastenague has the answer for you in a nutshell......corruption problems.
    Bottom line....the Time Capsule is for your backups.....not "everyday" files and especially not libraries.

  • Hello i would like to stop using outlook (office 2011) and use instead "mail": how can i transfer the database?

    hello i would like to stop using outlook (office 2011) and use instead "mail": how can i transfer the database?

    Hello Sylviefrombuenosaires, here is a link from macworld that can solve your question. Try reading this.
    http://www.macworld.com/article/158112/2011/02/export_outlook_ical.html
    Carlos

  • How can I change the database & schema used by an Application?

    Hi community,
    I am very new on Essbase and I need help to find out how can I change the database connection (and schema) used by the database of an Application. The figure is that I need to point this database to a QA environment (currently it points to DEV).
    If I do a right click over the properties of the database, I can see the following tabs: [ General ][ Dimensions ][ Statistics ][ Modifications ][ Compression ]. However, there is no option to change the database connection.
    Is there a way to do this?
    Thanks in advance for any help! Cheers!

    Are you trying to change a database connection of Planning application?
    Essbase application do not have a relational connection.
    Regards
    Celvin
    http://www.orahyplabs.com

  • How can I know the database is using Cost Based or Rule Based?

    Hi all expertise,
    How can I know the database is using Cost Based or Rule Based?
    If cost based it is using, what methods are need to use to minimize the cost when database is running? And which tables I can see the performance of the database?
    Thanks
    Amy

    how to see database setting ?
    use this
    SQL> sho parameter optimizer
    NAME TYPE VALUE
    optimizer_dynamic_sampling integer 1
    optimizer_features_enable string 9.2.0
    optimizer_index_caching integer 0
    optimizer_index_cost_adj integer 100
    optimizer_max_permutations integer 2000
    optimizer_mode string CHOOSE
    choose means if table statistics is available then it will use cost
    else
    use rule based optimizer
    for seeing performnace of table use
    set autotrace on
    and run your query
    if it doen't show cost.it means it use rule based
    for using cost based
    u will calculate table statistics
    9i
    dbms_stats.gather_table_stats('owner','table');
    8i
    analyze table <table_name> compute statistics;
    hope it will help you
    kuljeet pal singh

  • How can I use the free space of my Time Capsule as wireless HD ?

    Hi,
    Just set up a 2T Time Capsule and use it as Time Machine for my IMac and my MacBook.
    How can I use the 1 Tb free space to ave data available from all my devices ?
    Tks

    thierry118 wrote:
    Just set up a 2T Time Capsule and use it as Time Machine for my IMac and my MacBook.
    How can I use the 1 Tb free space to ave data available from all my devices ?
    Although it seems like you have a lot of extra space, Time Machine keeps versions, and if you want to take full advantage of the version history you should not worry about "extra space" because it will get used to provide safer coverage for the two Macs. If you had a Time Machine disk that fit your two Macs' hard drives perfectly, you would have no room for the version history, only room for the one most recent copy of each file. This can be a problem if you discover corruption that happened a while ago and cannot go back far enough in time to find an uncorrupted file.
    Therefore it's better to not try and use up the "extra space" and let it be used for a longer, safer version history for your backups.
    But like you, I want to use my Time Machine for additional network storage. So I plugged a cheap, compact hard drive into the Time Capsule USB port, and that shows up in File Sharing too. There is no need to buy anything fancier since it will be limited by both network speed and USB 2.0 anyway.

  • How can i used the "face time" is facetime is available here in the philippines?

    how can i used the "facetime",is facetime is available here in the philippines?

    Googling shows that FT is avaialbe in the Phillippines.  FT s prohibited in some middle eastern countries and iDevices officially purchased in thos countries eill not have FT and it can't be added back even if the iDevice is moved to a country that allows FT.

  • How can we use the SDXC PORT ?

    Hi,
    Im intending to buy a Macbook pro 15" and i wonder how can i use the SDXC to boot my future macbook.
    I heard there is out there some cards to make it boot faster. I am not talking here about sd camera cards.
    And do you think i made the right choice by choosing the 15" 2.2 ghz i7 ?
    Thank you

    fane_j wrote:
    There's only one way to make your "mac faster and use it every day"—replace the internal disk drive with an SSD, or replace the internal SSD with a bigger and faster SSD.
    Disk I/O has alwas been the main bottleneck of all computers. So you either make it occur faster or you reduce de times it needs to occur.
    In the "faster" section, the issues I have with SSDs are several:
    Their price still needs to go down way more. The cost per MB of SSD-based storage is still vastly greater than that of HDDs. Yes, if you compute in extreme environments like karting down Baja or skydiving off the Himalayas, a ruggedized SSD is great, but most of us mortals live in the safe confines of a homey office.
    The size of SSDs has to expand much more. Yes, they are inching up to the 500GB size, but HDDs are at 1TB and promise to break that barrier before the year is out.
    If you purchase your SSD preinstalled in your Mac, you will be paying a big premium, compared to marketplace SSDs, even those from the same maker but not Apple-branded. This also applies to RAM.
    If you put in a non-Apple-branded SSD, Lion will not enable TRIM support by default and you will have to go "under the hood" to enable it. Without TRIM, you will not get the full performance and durability benefit of an SSD.
    Might be me, but I prefer to stick with HDDs for now, just making sure they are of 7200RPM spindle speed.
    In the "reduce" section, must point out that Lion is a 64-bit beast. Meaning that all data structures are twice the size of previous 32-bit cats. Regardless of "minimum" specs, 4GB RAM is the new practical minimum and 8GB makes the fat cat much happier. But buying RAM from Apple is not a financially wise decision; an 8GB upgrade from reputable vendors can be had for around $40, in stark comparison to the $200 premium charged by the Apple store. For the same $200 or a bit less, you can get a 16GB upgrade instead, not officially sanctioned but that works just fine with the latest model Macs. In this case, I don't think the OP will need as much, but it is something to take under consideration. The extra RAM will drastically reduce the disk-based paging that the memory management carries out, thereby minimizing that bottleneck.

  • How can I use the Gmail app on the Watch?

    I do not use the Mail app on any of my Apple devices.  How can I use the Gmail app on the Watch?

    Since Google has not added watch support to the gmail app, you don't. You should be able to get notifications, but at this time, there is no gmail app for the watch.

  • How can I use two database in Dataset in SSRS?

    Hi,
    I am using one query to generate my SSRS report. In that query I am using subquery. Now I am pulling data from multiple tales.
    DB used in sub query is different than the rest of the tables DB.(So total I am using 2 DB(Database))
    So I see that in SSRS, I can connect query(In DataSet Properties) to one DATA_SOURCE only, how can I use other database which is I used in sub-query?
    I have to move this SSRS into PROD and I can't hard code that sub-query's DB name in my query.
    Please give me suggestion. Thanks!!
    Vicky

    In SSRS 2008 R2 you can use the Lookup function (http://technet.microsoft.com/en-us/library/ee210531.aspx ) and LookupSet function (http://technet.microsoft.com/en-us/library/ee240819.aspx
    Depending on your security set up, you can reference a table in a second database on the same server using a three part name:  database.schema.table.  This is more likely to work for you if you wrap your SQL command in a stored procedure.
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • How can I use the versionning tool to make a coherent solution to export

    how can I use the versionning tool to make a coherent solution to export all objects used in my project to other db schema for testing as well as for implementation .
    I want to know proper steps to Import/export objects.
    while I am exporting my Master repository and work repository then again importing the all , no problem comes all the physical logical schema mapping and mapping between interfaces retains but
    while I am trying to export and import one or two packages on the ease of testing then I am getting so many mismatches manually I am setting all why so?
    required ur suggestion
    Palash Chatterjee

    kelly-bot wrote:
    Thanks for the tip, but like I said, I dont want to always have to use the arrow keys. Is it not possible to actually DRAG one pixel at a time? I recently upgraded to CC from CS3 and I keep running into things that feel like a downgrade. Super disappointed.
    Our posts overlapped there.  Are you saying you could reliably drag one pixel with CS3? 
    What other issues are you having?  Things like the Crop tool can feel strange at first, but I promise you you'll never want to use Classic mode once you get used to it.

  • How can I use the color adjustments interface that shows up for camera RAW on jpeg files?

    How can I use the color adjustments interface that shows up for camera raw on other files types? The HLS controls had the secondary color adjustments (6 colors instead of the 3). Plus, it had same vibrancy and a better Curves interface. Yesterday was the first time I imported raw into Photoshop CS5 and I got that really cool interface. What is that? Can I use that on other file formats?

    Actually I am using the Tradional Chinese Version, when I try to edit the jpg file with camera raw, the system shows that there is no camera raw plug-in. The cmaera raw never work.

Maybe you are looking for

  • HT201269 A recent backup is not showing up for my ipone 5 (ios 7)?  How can I find it?

    I am in the process of having my ipone replaced.  In the process to satisfy apple that the phone needed replacing (front camera issues), they had me restore it to original settings, which I did.  Nothing changed, so they agreed to replace it.  Yey!  

  • Validation in VO based on sql query

    I need few inputs for the customization of OAF page. Business Need: Restriction of special character in supplier oaf pages for supplier name. There are 3 oaf pages involved in supplier creation/update for R 12.1.3 1)     oracle\apps\pos\supplier\webu

  • Reader 8.1.2 :  garbled / scrambled text when printing

    After upgrading to version 8.1.2 from 7.1, our work place noticed that certain PDF documents will print garbled text if the Reader window is closed prior to the document being completely processed in the Print Queue. (Windows XP) These documents are

  • FM for checking valid drive on PC

    Hi all, I am developing an interface. There is one file which is to be uplaoded in my code. I am doing some processing on that code and downloading that file on PC. User will enter the input & output file name. When user will enter the path I want o

  • Icons in Forms 6i

    I have an application which is working on Windows NT/workstation (client server) and forms 6i Now the problem is the icons in the menus and other places are not appearing .. only some icons like save clear have appeared others like query etc do not a