Problem updating a date field via UnitOfWork - TopLink 9.0.3
Hello,
we want to change an exisiting application that employs TopLink 9.0.3, Build 423.
The data is stored in an Oracle 9.2.0.6.
The specific table has a composite primary key consisting of four fields.
I can easily create a new Object (foo)
uow.registerNewObject(foo)
uow.commit()
and see the results in the database.
If I obtain an exising Object (bar) and change an integer
bar = (Bar) Session.readObject(Bar.class, expr);
cloneBar = (Bar) uow.registerObject(bar);
cloneBar.setSomething(42);
uow.commit()
everything is fine.
But if I dare to change a Date field
cloneBar.setSomethingElse(cal.getTime());
then
uow.hasChanges()
returns true
but the update does not happen. It is neither logged nor is the data changed in the database.
Is this a known bug?
What have I done wrong?
How can I avoid using hard-coded SQL to update my Bar object?
Bye,
Stephan
Hello,
it is very disturbing, but I finally found the reason for this problem.
After decompiling the Project class file (we have no source code of this third-party library), I saw that the mapping for this specific field is set to "readOnly".
I did not know that TopLink is able to have specific fields "readOnly" and others "readWrite", but it can handle this!
So it seems that the behaviour is not a bug but a feature :-(
We can change the mapping before creating the session, with the result that the field is updatable.
Have a nice day.
Similar Messages
-
Hi,
I have one table with a date field.
For display all rows in a table component i'm using a dateTimeConverter object with format 'dd/MM/aaaa' and work fine.
Bat when i update a data provider with follow code:
public String update_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
try {
myDataProvider.commitChanges();
myDataProvider.refresh();
} catch(Exception e) {
error("One error: " + e.getMessage());
return null;
return from brawser the follow message:
Number of conflicts while synchronizing: 1 SyncResolver.UPDATE_ROW_CONFLICT row 2 Data Exception -- No Applicable Cast Operator. from SQL type BINARY to SQL type DATE
Anyone help me!
Thanks.If you are getting the date from a calendar you have to convert it before storing it, for example, in the following code, the date got from the calendar is converted to a java.sql.Date
java.sql.Date date1 = new java.sql.Date(calendar1.getSelectedDate().getTime());
I hope this helps =) -
Hi all, im having a problem updating master data for an infoobject.
Im not able to upload the data from the data source and im not able either to update it manually.
Im getting this error Field symbol has not yet been assigned
can anybody hekp me?Ask your Basis team to implement this note in BI system..
Summary
Symptom
GETWA_NOT_ASSIGNED (a field symbol is not yet assigned) occurs when new master data providers are implemented after Note 1089231.
Reason and Prerequisites
This problem is caused by a program error.
This problem only occurs when display attributes are requested and no data is returned. -
How do I update a date field through CMP
I wonder how to update a date field through CMP.
For example, I can't update an employee table with following statement.
employee.setHire_date('2002-03-20');
Thanks,Thats correct......
Try using the following code....
String strDate ="2002-03-20";
String date_fmt = "yyyy-MM-dd";
java.text.SimpleDateFormat sdf=new java.text.SimpleDateFormat(date_fmt);
java.util.Date hireDate =null;
hireDate =(Date) sdf.parse(strDate);
employee.setHire_date(hireDate);
Hope this helps
Cheers
--Venky -
Update a date field using execute immediate statement..
I need to update a date field dynamically .
Below is the code I have written for the same..
EXECUTE IMMEDIATE
'UPDATE Temp_Emp ' ||
' SET ' || V_Fieldname || ' = ' || D_Value ||
'WHERE Emp_Id = ' || 8447;
I am getting the following error..
ORA-00904: "AUG": invalid identifier
Pls anyone have any ideas..
Thanks,
Xyzput D_Value in single quotes like this
EXECUTE IMMEDIATE
'UPDATE Temp_Emp ' ||
' SET ' || V_Fieldname || ' = ''' || D_Value ||''' WHERE Emp_Id = ' || 8447; -
Problem updating basic data text for a certain language via MM01 / MM02
We are facing the following problem :
We have materials where we maintain the basic data text via MM02 in different languages ( Dutch, English, French, German, Japanese and polish).
When we copy a material to a new one and we would like to update the basic data text we can do this directly except for some reason for Japanese.
For japanese we first must press the Editor Icon, we than get the editor were we can change the text and from that moment on everyting is ok.
But we would like to update the text like we do for the other languages without first pressing the editor icon.
We are running 4.7 and the sapgui is 7.1 patch 18.We are facing the following problem :
We have materials where we maintain the basic data text via MM02 in different languages ( Dutch, English, French, German, Japanese and polish).
When we copy a material to a new one and we would like to update the basic data text we can do this directly except for some reason for Japanese.
For japanese we first must press the Editor Icon, we than get the editor were we can change the text and from that moment on everyting is ok.
But we would like to update the text like we do for the other languages without first pressing the editor icon.
We are running 4.7 and the sapgui is 7.1 patch 18. -
Problem while saving date field in custom table
Hi,
Iam facing the following problem while saving a date field in custome table
i have a date field zdate in which the value is 02082010.
now when i try to insert this value in the custom table it is getting updated as 20/10/0208 , but it should be 08/02/2010
How can i correct it..
Regards
Kumarjust before saving u might have to use a string reverse FM and then save it..
CALL FUNCTION 'STRING_REVERSE'
EXPORTING
STRING = p_string
LANG = sy-langu
IMPORTING
RSTRING = r_string
EXCEPTIONS
TOO_SMALL = 1
OTHERS = 2 -
Is anyone else having problems with Apertures Date fields?
After experiencing a sysems failure I began restoring my images from backups. I have had no end of problems with Image dates. I have come to the determination that Aperture is NOT using either the "Create Date" or "DateTimeOriginal" as the image "Date" or "Date Created" data if other fields have other dates.
Here is a clip from my image metadata using exiftool:
File Modification Date/Time : 2012:09:23 19:53:15-04:00
File Access Date/Time : 2013:01:16 11:34:38-05:00
File Inode Change Date/Time : 2013:01:16 11:31:32-05:00
Create Date : 2006:02:20 11:51:12.10
Date/Time Original : 2006:02:20 16:51:12.10
Modify Date : 2006:02:20 11:51:12.10
And here is what Aperture utilized on import
Date: 9/23/12 7:53:15 PM EDT
Date Created 9/23/2012 7:53:15 PM
So Aperture utlized the File Modification Date/Time as the Create Date despite that the fact that the Create Date field is present and is properly formatted in the original image.
According to the Aperture mapping table, this shouldn't be happening.
Now, before someone recommends that I use Aperture's Date Adjust utility - I'm talking about slightly over 30,000 images. Editing images one at a time, or in blocks when you don't know what field Aperture is using as the Create Date would require individual inspection of each image followed by manual adjustment of each image. That approach isn't acceptable.Hmm ok, let me restate the issue then, I thought I was clear. I could have pointed out in my original post however, that only the EXIF and IPTC date fields were displayed from the metadata dump.
The data set presented in my first post is the EXIF dataset from the file which clearly shows the image was captured by digital camera at
Create Date : 2006:02:20 11:51:12.10
Date/Time Original : 2006:02:20 16:51:12.10
(The delta of 5 hours is the result of Zulu versus local time offset)
But, when I ingested it into Aperture, the import routine utilized the IPTC field
File Modification Date/Time : 2012:09:23 19:53:15-04:00
which is updated by the OS whenever you move the file around outside of Aperture. (a number of image data fields are updated by the OS - filename for example is another.). This resulted in the image date fields being stamped in Aperture as:
Date: 9/23/12 7:53:15 PM EDT
Date Created 9/23/2012 7:53:15 PM
Which obviously came form the File Modification Date/Time field and not (either) the Create Date or Date/Time Original fields. -
Problem with the date field in Table Control
I have created a table control in my module programming. One of the column in the table control is a date field which is I/O field.
Now if I enter a value in date field column and hit enter the date field is reset. I dont want the field to get reset and accept valid date field.
I have set type of the column as DATS and I havent used any dictionary fields. The column is from the internal table in the program.
Please suggestIn your PAI, in the LOOP AT <itab> did you
- check date validity
- update internal table
* Sample
LOOP AT itab.
FIELD itab-field MODULE checkfield.
MODULE updateitab.
ENDLOOP.
Look also at SAP documentation like [Table Controls|http://help.sap.com/abapdocu/en/ABENTABLE_CONTROL1_ABEXA.htm] or [Table Controls in ABAP Programs|http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbac9f35c111d1829f0000e829fbfe/frameset.htm]
Regards,
Raymond -
Problem Updating BLOB Data in DB
Hi, There,
I have a problem when updating BLOB data in database table. I am
using Oracle 8.1.6, JDK1.3.0., oracle thin driver.
I have a Handle object handle (javax.ejb.Handle), and I need to
save this object in DB. The table has 2 columns: column 1
is "PK" Varchar2(30) Primary Key, column 2 is "HANDLE" BLOB.
According to the documentation I found from Oracle, I first
initialize the blob column, and then get the BLOB locator.
However when I try to update the BLOB data by invoking
executeUpdate() method on OraclePreparedStatement ops, I always
get the returned int rowCount=0, which indicates that no rows
have been updated. (This is verified by trying to retrieve the
BLOB column value which results in SQLException: Exhausted
Resultset.)
Any suggestions what was wrong with the code? Thank you a lot in
advance!
Tom
Part of the code is listed below:
// If jSessionID is not found, create it
HttpSession session = request.getSession(true);
String jSessionID = session.getId();
//get the Hanlde object for MemberInfo bean
javax.ejb.Handle handle = memberValidate.validateMember(
memberID, "" );
oracle.sql.BLOB oracleBlob = null;
/* Get DB connection */
try
Connection conn = getDBConnection(); // with oracle thin driver
conn.setAutoCommit(false);
catch (NamingException ne)
System.out.println( "Failed to getDBConnection due to Naming
Exception" + ne.toString() );
return;
catch (SQLException sqle)
System.out.println( "Failed to getDBConnection due to SQL
Exception"+ sqle.toString() );
return;
try
pstmt=conn.prepareStatement("CREATE TABLE TOM1 (PK VARCHAR(30)
PRIMARY KEY, HANDLE BLOB NOT NULL)");
pstmt.execute();
pstmt=conn.prepareStatement("INSERT INTO TOM1 VALUES('ROW1',
EMPTY_BLOB())");
pstmt.executeUpdate();
pstmt=conn.prepareStatement("SELECT HANDLE FROM TOM1 WHERE
PK=? FOR UPDATE");
pstmt.setString(1, "ROW1");
ResultSet rset = pstmt.executeQuery();
if ( rset.next() )
// Get the LOB locator from the ResultSet
oracleBlob = ((OracleResultSet)rset).getBLOB("HANDLE");
OraclePreparedStatement ops = null;
ops = ( OraclePreparedStatement )
(conn.prepareStatement("UPDATE TOM1 SET HANDLE = ?
WHERE PK = ?"));
ops.setString( 2, jSessionID );
// using OutputStream to write object data
OutputStream oStream = oracleBlob.getBinaryOutputStream();
ObjectOutputStream outStream = new ObjectOutputStream
(oStream);
outStream.writeObject(handle); // handle is the Object to be
saved
outStream.close();
conn.commit();
conn.setAutoCommit(true);
ops.setBLOB( 1, oracleBlob );
int rowCount = ops.executeUpdate();
System.out.println("\n**** Rows affected: ");
System.out.println(ops.executeUpdate());
if (rowCount != 0)
// Commit the transaction:
System.out.println("\n**** conn.commit() OK...");
System.out.println("\n**** Handle saved in DB as Blob-type
OK...");
conn.commit();
conn.close();
else
System.out.println("\n**** ops.executeUpdate() == 0, Failed
to update DB");
conn.close();
return;
catch ( SQLException se )
se.printStackTrace();
return;
catch ( Exception e )
System.out.println(e.toString());
return;
System.out.println("\n**** DB update OK...");
nullYou cannot update Blob column in Adf testing tool as far i think
check this blog might help you to store images in ADF http://baigsorcl.blogspot.com/2010/09/store-images-in-blob-in-oracle-adf.html -
select date1, arrtime, deptime,
CASE WHEN arrdep = 'A' then
to_date(to_char(date1, 'dd/mm/yyyy')||to_char(to_date(arrtime, 'hh24:mi'), 'hh24:mi'), 'dd/mm/yyyy hh24:mi')
ELSE to_date(to_char(date1, 'dd/mm/yyyy')||to_char(to_date(deptime, 'hh24:mi'), 'hh24:mi'), 'dd/mm/yyyy hh24:mi')
END as DepArr from table1
output
====
date1 arrtime deptime DepArr
2005/10/25 0 0830 2005/10/25 08:30:00
2005/10/27 2215 0 2005/10/27 22:15:00
when i use the above select statement, the output displays fine, but when i tried to update the date1 field with DepArr, it fails with ORA-01861
update table1 set date1 =
CASE WHEN arrdep = 'A' then
to_date(to_char(dt, 'dd/mm/yyyy')||to_char(to_date(arrtime, 'hh24:mi'), 'hh24:mi'), 'dd/mm/yyyy hh24:mi')
ELSE to_date(to_char(dt, 'dd/mm/yyyy')||to_char(to_date(deptime, 'hh24:mi'), 'hh24:mi'), 'dd/mm/yyyy hh24:mi')
END
the date1 field's datatype is date
thanks.As far as I can see, your select can be simplified to:
select date1, arrtime, deptime,
to_date(to_char(date1, 'ddmmyyyy')||decode(arrdep, 'A', arrtime, deptime), 'ddmmyyyyhh24mi') as DepArr
from table1Make sure that date1 and arrtime/deptime is not null otherwise to_date will fail
Message was edited by:
Jens Petersen -
Problem with displaying Date field in the table.
Hi All,
I am trying to display data into a table UI Element.
In that data, i have one DATE type field. While displaying data in DATE field, it will display like this "01.02.2009".
Now my requirement is if i want to modify that DATE field, it will allow to modify "01.02.2009" to "26.02.2009".
But while modifying DATE field , I want to show the Calender of that month, in that i have to select the another date.
(Like normal Date UI Element will show that calender).
Can anyone please help me.
Thanks in Advance!
Regards,
Sreelakshmi.Hi,
Go to the context attribute that was mapped to the DATE field of the table and change the perperty INPUT HELP MODE to AUTOMATIC and it works.
Regards,
Manne. -
Discoverer 2000 : Problem in sorting date field on report
Hello,
I am not able to sort on date field on report
it is giving error as
( illegal operation).Thanks Savitha.
I found one more way of making that code work, just want to share this.
If we add the following statement, the same code works without having to add the time part along with date.
"DBMS_XMLSave.setdateformat(updctx, 'yyyy-MM-dd');"
note the format is case sensitive. Instead of MM, if you give 'mm' it won't work, it uses java format. -
Update a date field in SQL database
I am using MS SQL 2000..and .Jdbc-odbc bridge
I have a field of type datetime...
I am trying to update that field value...using the following code
rs.updateDate(fieldname,java.sql.Date.valueOf(fval));
rs.updateRow();
where fVal is a string...
It gives me a SQl Exception saying invalid date value..
Can any throw any light on this...helping me to overcome my error...This problem is solved...I am just inserting it as a string and the database takes care of everything...Now I have problems in inserting Integer value and a ntext value..
rs.updateInt(colname,1);
rs.updateRow();
This inserts a very big number like 1427560 etc into the database and second time it puts 0 to it...
For ntext it does not do anything
smita -
Hallo,
I changed a SAP custom table (added 1 extra field). Next I tried to update the meta data in Visual Studio, but the new field of the table is missing.
If I generate the proxy completely new, all fields of the table are visible.
Is there any limitation for updating table meta data ? The table contains 80 fields befor changing and 81 fields after chainging.
Any hints ?
Best regards,
G.Rausch
P.S.: As "workaround" I deleted the old proxy and genareted a new one, which worked fine. But this is no satisfactory solution at all.Hello,
I had the same problem in another VS Solution as well, but I managed to solve the problem
After closing the sapwsdl[Design] and opening it again all fields are visible.
Regards,
Gerhard Rausch
Maybe you are looking for
-
Remote App on iPhone 3GS unable to access iTunes library
Hi - I'm using an iPhone 3Gs with the latest version of iTunes 8.2(23). The remote app no longer works (it used to on an older iPhone and an older iTunes). I've read KB article at http://support.apple.com/kb/TS1741 and the iPhone and the MacBook have
-
I am using a MacBook Pro. I have my movies stored on a Lacie 1 TB external USB harddrive. (42 Movies in HD - 538 Gb in use). When I try to read the LaCie external drive, my MacBook Pro is "hanging". Only a "hard reboot" helps to get my MacBook Pro up
-
Hi Everyone, My Problem is when i set the edit option in field catalog respective field get converted into edit mode but the data of field is get disappear. wa_fcat1-fieldname = 'TRADESCHM'. wa_fcat1-coltext = 'TRADE SCHEME'. wa_fcat1-col_po
-
Synch to iPad from Photoshop Album
When I synch photos to iPad using Photoshop Album not all my photos synch. They were all taken with teh same camera & are the same size. I thought maybe the ones I edited were not synching, but that's not so. I have 63 photos in an album adn only 34
-
Theory: Firewalls essentially partition the Java Card platform's object system into separate protected object spaces called contexts. The firewall is the boundary between one context and another. The Java Card RE shall allocate and manage a context f