Hi Skip, So what I understand from you so far is the following regarding this bug: - It occurs only for a certain field inside a certain table? - It occurs only on postgres? - It occurs only when you persist? (i.e. the GenericValue is okay)
Can you confirm this much? Regards, On Wed, May 10, 2017 at 10:08 PM, Skip <[email protected]> wrote: > Thanks Jeremy > > That was a typo. It is actually description (lower case). I also took > the time to compare the description fields in ReturnItem and > VendingMachinePack in pgAdmin and they are identical except for Position. > > Also, because I can put data in this field using WebTools, I don't think > the issue is in postgres. > > I have written hundreds of custom services for ofbiz and millions of lines > of java code. This particular service is different in one regard. > > Usually, I write these kinds of services like this: > > transaction.begin > add new or modified records to a "toStore" iist > delegator.storeAll(toStore); > transaction.commit > > This one is different because I am modifying InventoryItem records in a > loop like this > > transaction.begin > get count of inventory items needed > while count > 0 > get inventory item and reduce count by availabletopromise > modify inventoryItem record and put in toStore > create a VendingMachinePack and other entities and add to > toStore > delegator.storeAll(toStore); > endwhile > transaction.commit > > So, as you can see, there can be multiple delegator.storeAll() calls in a > single transaction. However, I have spent three days testing this and I > can pick a product where a single inventoryItem exists that can fullfil the > request and the results are the same. > > Thanks again for thinking about this very strange issue. > > Skip > > > > -----Original Message----- > From: Jeremy Olmstead [mailto:[email protected]] > Sent: Wednesday, May 10, 2017 11:00 AM > To: [email protected] > Subject: Re: Problem with description field > > > This is a long shot but, in your statement below, description is spelled > incorrectly... > > Looking at the table with pgAdmin (I am using postgres), I find the field > DESCRITPTION as expected, but it is empty. > > On Tue, May 9, 2017 at 7:33 PM, Skip <[email protected]> wrote: > > > I have a problem with a field named "description". The problem is that > > when > > I write to this field, it never ends up in the database. > > > > The entity definition looks like this: > > > > <entity entity-name="VendingMachinePack" > > ... > > field name="description" type="description" > > field name="descAgain" type="description" > > ... > > > > I write to the field like this: > > > > Map input = UtilMisc.toMap(...); > > input.put("description", description); > > input.put("descAgain", description); > > > > ... > > GenericValue newPack = delegator.makeValue("VendingMachinePack", input); > > System.out.println("Have Pack = " + newPack); > > //newPack.create(); > > toStore.add(newPack); > > > > System.out.println("Have description " + newPack.getString(" > > description")); > > > > .... > > > > delegator.storeAll(toStore); > > > > My log file shows the correct description from the > System.out.println("Have > > description " statement. > > > > However, looking at the table using WebTools, the description field is > > EMPTY!!! > > > > I added a second description field called "descAgain" and this shows up > > fine > > as well as all the other 20 fields in the table. Just the description > > field > > is empty. > > > > There are dozens of uses of "description" as a field name. > > > > Looking at the table with pgAdmin (I am using postgres), I find the field > > DESCRITPTION as expected, but it is empty. > > > > I have tried deleting the table with pgAdmin and having it automatically > > recreated. As can be seen above, I have tried calling newPack.create(); > > instead of delegator.storeAll(toStore); as well as a bunch of other > stuff. > > > > Nothing I have tried has any effect on "description" this field. > > > > My log file has no errors. > > > > Anyone have any ideas on what might be going on? > > > > Skip > > > > > >
