Saturday, February 19, 2011

Bad CopyForce jars posted....just replaced.

Thanks to Amarnath Venkataswamy I discovered that the last CopyForce downloads I posted to google code were bad. The short reason -- I fat fingered a thread.join() line in the CopyForce.main() method. Bummer! My unit tests call nearly everything at 98% coverage EXCEPT the main().

If you are one of the ~35 people that downloaded it last week, all versions of CopyForce will simply terminate with no error message.

Tuesday, February 15, 2011

I Love sqlforce

This morning the head of our consulting division decided to change the stage names used by opportunities. Before taking this step, I wanted to take a look at what stage names have actually been used by sales staff.
If I was working with a regular SQL database, I would simply run:
SELECT DISTINCT stageName Opportunity
How can I run the same query on a Force database?  Easy....start sqlforce and enter:
SELECT DISTINCT stageName from Opportunity

Case closed.

Friday, February 11, 2011

Updates to CopyForce

Monthly updates to SqlForce, CopyForce, etc. were posted on http://code.google.com/p/sqlforce/ this morning.
The two issues reported this month are fixed in the updates:

  • encrypted fields now work.
  • GMT DateTime conversion is now correct.
It has been a healthy month for downloads. CopyForceSQLServer is the most popular download but CopyForceOracle is gaining ground.

We are nearly ready to launch a commercial version of the code -- CopyForcePro.  The primary advantages of the commercial version  will be usability/accessability, support, and secure packaging for production environments. The core codes will stay open source under the EPL.

For operational use, I am finding it much easier to load a single configuration file and immediately restore my setup:


Please drop me a line at  gsmithfarmer@gmail.com. The occasional "it's working well for us" is always good news (as is any defect report).


Wednesday, January 5, 2011

Copy Salesforce to a SQL/Server Financal System.

We wanted to have a copy of our Salesforce price books available on our financial system but did not want to write custom code to do it.  We did the schema creation and copy in 5 minutes using CopyForceSqlServer (4 minutes development + 1 minute execution time).

How simple can it get!


SET SFDC=production
SET SQLSERVER=//localhost;databaseName=MyCompanyTools;username=salesforce;password=miracle;


java -jar CopyForceSqlServer.jar -salesforce %SFDC% -sqlserver "%SQLSERVER%" -include product2,pricebook2,pricebookentry -schema -querybatch 1000

Later we will set this up as a CRON job to keep our financial system up to date automatically.

Friday, December 31, 2010

Beware the Salesforce QueryOptions parameter

When I learned that CopyForce was using up almost 1GB of memory copying some SalesForce instances, I had to understand why.  Three hours later.....the default batch size return from a SalesForce API query is 1000 rows.  Since CopyForce grabs all columns in a table, the amount of memory required can get huge. The solution:

  • Set the "QueryOptions" parameter in the binding header.
The next revision of CopyForce will choose values for this parameter that cause memory usage to stay below 200mb (app and data). Naturally, CopyForce will also include a new flag to control the number of rows in a batch at runtime.

It looks like CopyForceOracle will be ready to post on Monday. It is passing of the standard CopyForce unit tests and copied my large test database with flying colors.

Tuesday, December 28, 2010

Cranking with CopyForceOracle

I had a few hours free last weekend and took a stab a CopyForceOracle (copy all or part of a SalesForce instance to Oracle). The status is pretty good:

  • 1.0 code has been checked into SVN
  • No problems seen when copying a 4GB Salesforce instance (all tables) to Oracle 10g/XE. The Salesforce instance has ~9000 account, 45000 contacts, 70000 assets, etc.
  • Application seems to need about 500mb to run (e.g. using . -Xm500m). This is a mystery I will look into. It is more memory usage than I would expect. I am flushing to Oracle every 2MB from Salesforce.
Volunteers are need to try this out on their own production SalesForce instances.

Time for a workout at the YMCA.

Monday, December 20, 2010

CopyForceOracle or Something else?

I have been thinking about creating a version of CopyForce for Oracle (CopyForceOracle) using one of Oracle's type 4 drivers. Since I do not have a near term need, I am looking for 4-5 sites to help me test it. If a few people step up, I will put a version together. I have a few years of Oracle/JDBC practice and think creating a version that passes the CopyForce unit tests should take no longer than a week (part time).

Volunteers willing to lend a testing hand please drop me a note at gsmthfarmer@gmail.com.

Downloads of the various sqlforce tools are holding steady at 10-20 per week. Feedback is fairly sparse (not surprising since I rarely post comments on a tool that works). If you are using one of the tools, drop me a note --  good or bad feedback is welcome.