Source: The Canadian Press

The Toronto stock market closed sharply higher Tuesday as commodity prices rose amid hopes for higher demand.

Strength also came from tech sector heavyweight Research In Motion Ltd. following a report that the BlackBerry maker is working on a media tablet to compete with Apple’s iPad.

The S&P/TSX composite index jumped 240.2 points to 11,907.54 while the TSX Venture Exchange was ahead 8.73 points to 1,461.51.

The Canadian dollar was up 0.7 of a cent at 97.55 cents US.

The TSX energy sector rose 2.1% as the July crude contract on the New York Mercantile Exchange rose $1.82 to US$76.94 a barrel, the highest price since early May.

The surge in crude prices came ahead of weekly supply data from the American Petroleum Institute later in the day while the U.S. Energy Department’s Energy Information Administration releases its report Wednesday. Analysts expect a drop of 1.8 million barrels in the U.S. supply, according to a survey by Platts, the energy information arm of McGraw-Hill Cos.

Oil traders have been encouraged in recent weeks by a fall in U.S. crude inventories, which suggests an economic recovery is raising demand.

Suncor Energy (TSX:SU) gained 97 cents to C$34.48 while Canadian Natural Resources (TSX:CNQ) improved 75 cents to C$38.02.

Shares in Research In Motion (TSX:RIM) jumped $3.16, or 5.15%, to $64.49 following reports that the company is working on a media tablet to compete with Apple’s iPad. The Wall Street Journal and other tech websites have reported that RIM is developing a tablet computer that would be used with its BlackBerry smartphones.

Despite Tuesday’s sharp gain on the TSX and a climb of almost 1% last week, analysts think the positive feeling is likely to be short-lived.

Sid Mokhtari, market technician at CIBC World Markets, pointed out that the problems that have pressured stock markets recently — fear of government debt default in Europe and a slower than expected economic recovery in the U.S. — haven’t gone away.

“We want to be cognizant of the fact that not too many things went away. It wasn’t just a bad dream,” said Mokhtari, who thinks markets are experiencing a summer rally that won’t last more than a few weeks.

“The stock market is saying: everyone was betting on huge growth potential and, oops, we don’t have it.”

Elsewhere on the TSX, the base metal sector was ahead 3.24% as the July copper in New York gained one cent to US$3 a pound, adding to five days of gains, as data from China showing rising exports encouraged demand prospects. Teck Resources (TSX:TCK.B) advanced $1.40 to C$36.50 while Western Coal Corp. (TSX:WTN) rose 16 cents to C$4.98.

The financial sector advanced 2.3% as Scotiabank (TSX:BNS) gained $1.19 to $51.40.

CIBC shares were ahead $2.31 to $75 after the bank announced late Monday it has signed a deal to buy a $2.1-billion credit card portfolio from Citigroup’s Canadian MasterCard business. The transaction makes the big bank Canada’s largest issuer of Visa and MasterCard credit cards.

Gold stocks were also positive as the August bullion contract on the Nymex advanced $9.90 to US$1,234.40 an ounce. Barrick Gold Corp. (TSX:ABX) was ahead 70 cents at C$44.02 while Kinross Gold Corp. (TSX:K) climbed 38 cents to C$18.10.

U.S. stocks were also higher amid both weaker-than-expected earnings from electronics chain Best Buy Co. and data showing expanding manufacturing activity in the U.S. Northeast.

The Dow Jones industrial average surged 213.88 points to 10,404.77. The Nasdaq composite index gained 61.92 points to 2,305.88 while the S&P 500 index was up 25.6 points to 1,115.23.

Best Buy’s fiscal first-quarter net income and revenue fell short of analysts’ expectations but the company reiterated its fiscal 2011 forecast. The report brought concerns that consumers will cut spending and hurt the U.S. recovery. Best Buy shares fell $2.47 or 6% to US$38.58.

In other economic news, Statistics Canada reported manufacturing sales advanced 0.2% in April to $44.5 billion. The federal agency said sales increases by primary metal, petroleum and coal producers were largely offset by a decline in the food industry. However, the advance was less than the 0.3% economists had been expecting.

The U.S. Federal Reserve said its Empire State Manufacturing Index, a snapshot of manufacturing activity from the U.S. Northeast, came in at 19.57 in June, up from 19.11 in May.

Other data showed that U.S. homebuilders are losing confidence in the housing market now that government incentives that spurred home sales have ended. The National Association of Home Builders said its housing market index fell to 17 in June, sinking five points after two straight months of increases. It was the lowest level since March.

Investor sentiment was lifted by news that China has boosted its holdings of U.S. Treasury debt for the second straight month as total foreign holdings of U.S. government debt increased. That development should help ease concerns that lagging foreign demand will force the U.S. government to pay higher interest rates to finance its debt.

Also adding to the sharp gains was Boeing Co., which said it was boosting production. The news sent its shares up $2.66 or 4.1% to US$67.48.

In other corporate news, ratings agency Fitch has downgraded BP’s long-term issuer default rating and senior unsecured rating to BBB from AA because of worries about the continuing Gulf of Mexico spill.

Fitch said it was concerned both by reports from U.S. government scientists that the volume of the spill was significantly larger than previously indicated, and pressure from U.S. officials on BP to pay billions of dollars into an escrow account to guarantee payment of cleanup costs. BP shares added 72 cents to US$31.39 after falling 10% on Monday.

Legacy Oil + Gas Inc. (TSX:LEG) has acquired CanEra Resources Inc., a private oil company operating in the historic Turner alley oilfield in southwest Alberta in a friendly deal. Legacy said Tuesday it has paid $241 million in cash and 20.5 million shares, worth $262.2 million at the current stock price — a total value of $503 million. Legacy shares fell 60 cents to $12.19.

Shares in Agrium Inc. (TSX:AGU) were up $1.28 to $54.87 after the farm products giant said several potential takeover targets are ripe for the picking in North America that would help grow its retail business. Agrium has identified more than 100 potential buyout candidates across the United States representing some 300 retail outlets and more than $2 billion in revenues.