Sitemap

Amicuk Programming Answers

Changes commited to the database only after I update OracledataAdapter twice

-0001-11-30   Views:0

Advertisement

Hi. I am using oracledataadapter to manage the data which is eventually displayed in winform datagridview (Visual Studio 2012) everything works fine , but I have to click "Save" buttin twice to see the changes in the database (Oracle express 11g

Hi. I am using oracledataadapter to manage the data which is eventually displayed in winform datagridview (Visual Studio 2012)
everything works fine , but I have to click "Save" buttin twice to see the changes in the database (Oracle express 11g)
Can you please advice....
Here is my code
it is very simple
1. Obtain connection
2. Create dataadapter
3. Create commands
4. Fill the datatable and dataset
public partial class Concordance : Form
        OracleDataAdapter setupAdapter;
        DataSet projDataset;
        OracleConnection conn;
        //binding sources
        BindingSource setupBindingSource = new BindingSource();
        DataTable setupTable;
        public Concordance()
            InitializeComponent();
            //load tables
            loadSetup();
        //setup table
        private void loadSetup()
            string oradb = ConfigurationManager.ConnectionStrings["OpenU"].ConnectionString;
            conn = new OracleConnection(oradb);
            try
               // using (conn = new OracleConnection(oradb))
                setupAdapter = new OracleDataAdapter("select * from ou_setup", conn);
                    OracleCommandBuilder builder = new OracleCommandBuilder(setupAdapter);
                    projDataset = new DataSet("Concordia");
                    setupTable = new DataTable("Setup");
                    projDataset.Tables.Add(setupTable);
                    setupAdapter.Fill(projDataset,"Setup");
                    //bind the gataGridView
                    this.setupGrid.DataSource = projDataset.Tables["Setup"];
                    this.setupBindingSource.DataSource = projDataset.Tables["Setup"];
                    this.setupNavigator.BindingSource = this.setupBindingSource;
            catch (Exception ex)
                string error = ex.Message;
                MessageBox.Show(error);
        private void saveSetupBtn_Click(object sender, EventArgs e)
           // only after sabe button clicked for the second time the changes are commited into the database
            this.setupAdapter.Update(projDataset.Tables["Setup"]);
            MessageBox.Show("saved");

The replay answer
Advertisement
How are you reading in the object initially? The problem is likely that you are modifying an object from the session cache. When you then read in the object from the uow, it uses the object in the session cache as the back up. So there will not appear to be any changes to persist to the database.
You will need to make a copy of the object for modification, or use the copy from the unitofwork to make the changes instead of working directly on the object in the session. Disabling the cache means there is no copy in the session cache to use as a back up, so the uow read has to build an object from the database.
Best Regards,
Chris

Go to See the other 3 answers

Changes commited to the database only after I update OracledataAdapter twice

Category:DefaultRelease time:-0001-11-30Views:130

Hi. I am using oracledataadapter to manage the data which is eventually displayed in winform datagridview (Visual Studio 2012) everything works fine , but I have to click "Save" buttin twice to see the changes in the database (Oracle express 11g[More]

Why is my  CLEAR_BLOCK(no_validate) not committing to the database?

Category:DefaultRelease time:2015-10-11Views:130

What I need is when the alert button 1 is selected fo to the detail block(ADM) and just delete everything for the current master id. When I click on the button it deletes for a split second and all the data comes back.Quite confused.. IF Id_Null(al_i[More]

TopLink cached object changed are not commited to the database

Category:DefaultRelease time:2015-10-11Views:130

Hello, I'm using TopLink 10 and I have a writing issue with a use case: 1. I read an obect using TopLink that is in the IdentityMap 2. Using JSF this object is edited throught a web form. 3. I give the modified object to the data layer and try to mod[More]

Getting only the rows committed in the database

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I have one strange requirement in my application. I need to fetch the rows from a particular table in the database which are committed. I mean there are other view objects for that table and those view objects are manipulating the data in that ta[More]

I have a column where I have implemented writeback, its working fine. On top of this I need to show 0 as No and 1 as yes in our report, that is also done. Now I want to enter Yes in a column where it was no and I want database table to get update with 1.

Category:DefaultRelease time:2015-10-11Views:130

I have a column where I have implemented writeback, its working fine. On top of this I need to show 0 as No and 1 as yes in our report, that is also done. Now I want to enter Yes in a column where it was no and I want database table to get update wit[More]

File-to-rfc ..database tables are not updating??

Category:DefaultRelease time:2015-10-11Views:130

hi xi friends.. in my file -to-rfc scenario.. without BPM .. in sxmb_moni..it is showing successfull.. database tables in sap not updating.. my source structure.. workorders 1..1 ..order 1..unbounded ...id ...operation 1..unbounded .....id .....closi[More]

How to lock a database Z table before updating it through a report program

Category:DefaultRelease time:-0001-11-30Views:130

Hi, How to lock a database Z table before updating it through a report program and also how to unlock it after my updation. The whole process is done through report program.Hi, Go to SE11, in the option 'Lock object' enter the name of your lock, begi[More]

Database history growth not updating after EHP upgrade

Category:DefaultRelease time:-0001-11-30Views:130

Hi All, We are using SAP ECC 6.0 (731 - SP09 )  & DB2 Fix pack 5 version.Database history growth not updating after EHP upgrade. I have check  collector job running fin and DB tab > Configuration > Data Collection Framework > Configuration Co[More]

How i can enter information from Database to jtree and update it

Category:DefaultRelease time:-0001-11-30Views:130

How i can enter information from Database to jtree and update itIs the memory cache enabled (about:cache)?<br /> You can open about: pages via the location bar like you open a website. *http://kb.mozillazine.org/browser.cache.memory.enableRead other[More]

Database that can automatically update ebooks w/embedded flash

Category:DefaultRelease time:-0001-11-30Views:130

Hi I have a client who thinks it's possible to set up a database that will automatically update ebooks/pdf files with embedded flash so that manual translation between languages (e.g. english/norwegian/german/russian) can be avoided.  I'm trying to e[More]

Trigger changes are not committing to the database

Category:DefaultRelease time:2015-10-11Views:130

I have 9iAS and 9i DB both on my laptop. I am having a problem in which a trigger run off a WHEN_BUTTON_PRESSED function is not committing the changes to the database. In the trigger I have: 1 record insert into table A. 1 record update to table B. 1[More]

Hot
HHow can I print out my contacts from my iPad or iPhone?Hi Ken, there is an app, Contact Sheet (http://itunes.com/apps/appiota/contactsheet) that will not only print your contacts, it can also print the pictures!  This app can be used to back up, sha [More]
How to Block a Vendor for Down Payment. Both f-47, f-48 and automatic f100 should not work for this vendor. please tell me the settings. Thanks in Advance,Hi, Using the Validation you can do i hope, because -  there are two fields which are relating [More]
Forms 6i Database 10g When I access a simple data record in an oracle form that consists of a CODE and DESCRIPTION where the CODE is part of the primary key, the CODE field is typically read-only and this is evident by the shade of the item. The item [More]
I bought several apps on my phone, and I am unable to sync them back to iTunes (I'm on v7.7, iPhone 2.0). They work great on my phone, but they have not copied to iTunes. I get a prompt on sync about "purchased items on your phone not in iTunes libra [More]
Hi, I copied a standard form from client 000 into a Z form. How can i set its orginal languages as english ?Go to the "DE" version of your "Z" form.   Click utitlies,  convert original language.  Regards, Rich HeilmanRead other 2 answe [More]
Hello, I am trying to download a free application using my Apple Id and the password but in the Billing Information step, there is no "None" option and I do not have a credit card. What can I do ? Thank You in advance.Thanks for this link but I [More]
Here is the scenario: 1. Created logical star schema model including a dimension with nested subtypes (SuperTypeEntity1 -> Subtype 1 -> Nested Subtype 2) 2. Forward engineer to Relational model using Single Table implementation 3. Create Oracle 11g [More]
i have an old version of itunes 4.8 or something, i'm trying to uninstall. i then want to install the latest version. i went to add/remove programs in the control panel. it no longer is in the add/remove, but there is still an icon on desktop and whe [More]
Hi Friends, I am getting a message 'Message no. F5 480' *'For document type SA, an entry is required in field* Doc.head.text' when trying to settle a production order through transaction KO88. Can you help me in this. Regards SameerDear, I'm not sure [More]
Hi well i have following incoming structure: <?xml version="1.0" encoding="UTF-8"?> <ns0:MT_EPOSYS xmlns:ns0="http://XXX">    <EPORecordSet>       <EPOFileHeader>          <BDKDNR>0000007531</ [More]