Connection Pooling doesn't work.

Good day. all
I've tested OracleConnectionPoolDataSource and OracleDataSource.
And found that there is no performance difference. And connections are not pooled to my mind.
My sample fill table with records, and than read and update concurrently it in two threads.
Bellow is a code provided.
<strong>
A piece of logs</strong>: each time new connection is created.
connection= oracle.jdbc.driver.OracleConnection@1198891
0. updatedNumber= 1
connection.close()= oracle.jdbc.driver.OracleConnection@1198891
connection= oracle.jdbc.driver.OracleConnection@17725c4
connection.close()= oracle.jdbc.driver.OracleConnection@17725c4
list.size()= 10
0, name_update0, name_desc0, name_status0, 2008-11-04, 2008-11-04.
1, a1, c1, b1, 2008-11-04, 2008-11-04.
viewing the logs I see that every time new connection is created in both cases whether I use OracleConnectionPoolDataSource or OracleDataSource.
<strong>
Question:</strong> Can anybody help me to understand how to use Connnection pooling? And how to see with my own eyes that it works?
<strong>DDL</strong>:
to run the program one should create table:
{color:#000080}CREATE TABLE TEST_RECORD1 (
ID NUMBER(10) NOT NULL PRIMARY KEY,
NAME VARCHAR2(255 BYTE) ,
STATUS VARCHAR2(255 BYTE) ,
DESCRIPTION VARCHAR2(255 BYTE),
START_DATE TIMESTAMP ,
END_DATE TIMESTAMP
);{color}
<strong>
Java Code</strong>:
package test.jdbc;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.sql.ConnectionPoolDataSource;
import javax.sql.DataSource;
import oracle.jdbc.pool.OracleConnectionPoolDataSource;
import oracle.jdbc.pool.OracleDataSource;
public class TestConnectionPooling2 {
static DataSource dataSource;
/** number of iterations */
static final long BASE_REPEAT_NUMBER = 5;
static final long RECORDS_NUMBER = 10;
public static void main(String[] args) throws Exception {
//here you can change data source (pooled or no), but performance won''t change
// setupDataSource( new OracleDataSource());
setupDataSource(new OracleConnectionPoolDataSource());
long startTime = System.currentTimeMillis();
//clean table
removeAllRecords("delete from test_record1");
//insert records into table
for (int i = 0; i &lt; RECORDS_NUMBER; i++) {
insertRecord(i,
"insert into TEST_RECORD1 (id,name,status, description, start_date, end_date) "
+ " values (?, ?, ?, ?, ?, ?)");
//setup thread which queries data from table
Thread th1 = new Thread("thread 1") {
public void run() {
for (int i = 0; i &lt; BASE_REPEAT_NUMBER; i++) {
retrieveRecords("select * from test_record1 order by id asc");
Thread.yield();
//setup thread which updates data on table
Thread th2 = new Thread("thread 2") {
public void run() {
for (int counter = 0; counter &lt; BASE_REPEAT_NUMBER; counter++) {
for (int i = 0; i &lt; RECORDS_NUMBER; i++) {
performSingleUpdate(counter, i,
"update TEST_RECORD1 set name = ?, description=?, status=? where id=?");
Thread.yield();
th1.start();
th2.start();
//do not finish until threads work
while (th1.isAlive() || th2.isAlive()) {
Thread.yield();
long endTime = System.currentTimeMillis();
System.out.println("Execution time:" + (endTime - startTime) + " ms.");
private static void performSingleUpdate(long counter, long i, String sql) {
PreparedStatement stmt = null;
Connection conn2 = getConnection();
try {
stmt = conn2.prepareStatement(sql);
long temp = counter * 10 + i;
stmt.setString(1, "name_update" + temp);
stmt.setString(2, "name_desc" + temp);
stmt.setString(3, "name_status" + temp);
stmt.setLong(4, i);
int updatedNumber = stmt.executeUpdate();
System.out.println(counter + ". updatedNumber= " + updatedNumber);
} catch (SQLException e) {
e.printStackTrace();
} finally {
try {
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
if (conn2 != null) {
closeConnection(conn2);
private static void removeAllRecords(String deleteAllSQL) {
Statement stmt = null;
Connection conn2 = getConnection();
try {
stmt = conn2.createStatement();
int updatedNumber = stmt.executeUpdate(deleteAllSQL);
System.out.println("Deleting all records. updatedNumber= " + updatedNumber);
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
} finally {
if (conn2 != null) {
closeConnection(conn2);
public static void retrieveRecords(String sql) {
List list = new ArrayList();
Statement stmt = null;
ResultSet resultset = null;
int recordsCounter = 0;
Connection connection = getConnection();
try {
stmt = connection.createStatement();
resultset = stmt.executeQuery(sql);
while (resultset.next()) {
Record newRecord = new Record();
recordsCounter++;
newRecord.setId(resultset.getLong("id"));
newRecord.setName(resultset.getString("name"));
newRecord.setDesc(resultset.getString("description"));
newRecord.setStatus(resultset.getString("status"));
newRecord.setStartDate(resultset.getDate("start_Date"));
newRecord.setEndDate(resultset.getDate("end_Date"));
list.add(newRecord);
} catch (SQLException e) {
e.printStackTrace();
} finally {
if (resultset != null)
try {
resultset.close();
} catch (Exception e) {
e.printStackTrace();
if (stmt != null)
try {
stmt.close();
} catch (Exception e) {
e.printStackTrace();
if (connection != null) {
closeConnection(connection);
StringBuilder sb2 = new StringBuilder("list.size()= " + list.size() + "\n");
for (int i = 0; i &lt; list.size(); i++) {
Record record = (Record)list.get(i);
sb2.append(" " + record.toString() + "\n");
System.out.println("" + sb2);
public static void insertRecord(long counter, String sql) {
PreparedStatement stmt = null;
Connection conn2 = getConnection();
try {
stmt = conn2.prepareStatement(sql);
stmt.setLong(1, counter);
stmt.setString(2, "a" + counter);
stmt.setString(3, "b" + counter);
stmt.setString(4, "c" + counter);
stmt.setTimestamp(5, new java.sql.Timestamp(System.currentTimeMillis()));
stmt.setTimestamp(6, new java.sql.Timestamp(System.currentTimeMillis()));
int updatedNumber = stmt.executeUpdate();
System.out.println(counter + ".insertNumber= " + updatedNumber);
} catch (SQLException e) {
e.printStackTrace();
} finally {
try {
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
if (conn2 != null) {
closeConnection(conn2);
// Initial methods
private static void setupDataSource(OracleDataSource oracleDataSource) throws SQLException {
OracleDataSource ds = oracleDataSource;
ds.setUser("akhlystov");
ds.setPassword("xallex");
ds.setURL("jdbc:oracle:thin:@localhost:1521:abc");
dataSource = ds;
public static DataSource getDataSource() {
return dataSource;
private static void closeConnection(Connection connection) {
if (conn != null) {
return;
System.out.println("connection.close()= " + connection + "\n");
try {
connection.close();
} catch (SQLException e) {
throw new RuntimeException(
"application should not work when database can't close connection");
static Connection conn;
public static Connection getConnection() {
* uncomment to test without any data source, single connection if ( conn ==
* null){ try { conn = getDataSource().getConnection(); } catch
* (SQLException e) { e.printStackTrace(); } } return conn;
try {
Connection connection =null;
if ( getDataSource() instanceof ConnectionPoolDataSource){
connection = ((ConnectionPoolDataSource)getDataSource()).getPooledConnection().getConnection();
}else{
connection = getDataSource().getConnection();
System.out.println("connection= " + connection);
return connection;
} catch (SQLException e) {
e.printStackTrace();
throw new RuntimeException("application should not work when database is unavailable");
// Record class
static class Record {
long id;
String name;
String desc;
String status;
Date startDate;
Date endDate;
public long getId() {
return id;
public void setId(long id) {
this.id = id;
public String getName() {
return name;
public void setName(String name) {
this.name = name;
public String getDesc() {
return desc;
public void setDesc(String desc) {
this.desc = desc;
public String getStatus() {
return status;
public void setStatus(String status) {
this.status = status;
public Date getStartDate() {
return startDate;
public void setStartDate(Date startDate) {
this.startDate = startDate;
public Date getEndDate() {
return endDate;
public void setEndDate(Date endDate) {
this.endDate = endDate;
public String toString() {
return id + ", " + name + ", " + desc + ", " + status + ", " + startDate + ", " + endDate + ".";
Edited by: Alexandr Khlystov on 04.11.2008 20:14

The relevant documentation for the 9i JDBC drivers is here http://download.oracle.com/docs/cd/B10501_01/java.920/a96654/connpoca.htm#1056354.
In the 9i JDBC driver world,there was a distinction between a connection pool (pooled connection) and a connection cache.
A connection pool attempts to eliminate the overhead and resource consumption of connecting and disconnecting from the database. If the connection is going to be reused then no point in closing the connection just to open it up again.
What performance gain were you looking for? You would only see a performance gain if your application was constantly opening and closing connections, requiring all the resources to setup and tear down database communications. Once a connection is established there is no difference in performance of the execution of SQL.
You can see this with
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import oracle.jdbc.pool.OracleConnectionPoolDataSource;
import oracle.jdbc.pool.OracleDataSource;
import oracle.jdbc.pool.OraclePooledConnection;
public class TestConnectionCache {
  public static void exec(Connection conn) throws SQLException {
    ResultSet rs = conn.prepareStatement("select sys_context('USERENV','SESSIONID') from dual").executeQuery();
    rs.next();
    System.out.println("Session id: " + rs.getInt(1));
    conn.close();
  public static void main(String[] args) throws SQLException {
    OracleDataSource ods = new OracleConnectionPoolDataSource();
    ods.setUser("...");
    ods.setPassword("...");
    // Construct the jdbc url.
    String host     = "...";
    String port     = "...";
    String instance = "...";
    String url =
      "jdbc:oracle:thin:@//" + host + ":" + port + "/" + instance
    ods.setURL(url);
    // No connection re-use.
    exec(ods.getConnection());
    exec(ods.getConnection());
    // Connection re-use. (Connection pooling)
    OraclePooledConnection opc = (OraclePooledConnection)((OracleConnectionPoolDataSource)ods).getPooledConnection();
    exec(opc.getConnection());
    exec(opc.getConnection());
}Produces output similar to:
Session id: 4110149
Session id: 4110150
Session id: 4110151
Session id: 4110151Note when connection pooliing is used, the database session id is the same. Calling close() did not close the physical connection.
A connection cache is a layer on top of pooled connections that manages the creation and destruction of connections. It usually has limits as to how many connection it should open and the max number of connections to allow. Then when the cache is asked for a connection, it can return one that is not in use, or possibly create a new one.
The later versions of the JDBC driver greatly simplify managing your connections and here is the note from the docs:
Note:
The previous cache architecture, based on OracleConnectionCache and OracleConnectionCacheImpl, is deprecated. Oracle recommends that you take advantage of the new architecture, which is more powerful and offers better performance.
Any reason why your are not using a more recent JDBC driver?

Similar Messages

  • I updated my iphone 5 to ios 6.0.2. my wifi says its connected but doesn't work now. It doesn't matter what wifi network I connect to. It worked before updating my phone. I can no longer use facetime or use wifi at all. I'm not sure what to do to fix it.

    I updated my iphone 5 to ios 6.0.2. my wifi says its connected but doesn't work now. It doesn't matter what wifi network I connect to. It worked before updating my phone. I can no longer use facetime or use wifi at all. I'm not sure what to do to fix it.

    I'm having similar issues with my phone.  I got my first iPhone recently, only had an iPod touch gen4 for a little over a year.  Updated to 6.0.2 when we got the phone (iPhone 5) a few days before Christmas.  When I got home on the evening of January 11, my phone would not connect the router anymore.  I was able to get it to connect after resetting the phone and the router, updating the router, and manually connecting.  That laste for a few minutes and then wouldn't work anymore.   I live in an area with very limited service, we have a network extender installed to help, and I am barely getting a 3G signal at times.
    My wife's iPad 4, my touchiPod 4, and all of our laptops are working just fine on the router.  When I dropped my kid off at school today, I noticed that I am not even seeing the school network anymore from the parking lot where before I got 3 or 4 bars and could connect to their wifi when I was there.  Today my phone goes back and forth between seeing my home network but not connecting, to not even seeing the network at all even from the same room that the router is in.
    Hope Apple fixes this problem soon..............

  • After a long in "stop" period, the internet connection (ethernet) doesn't work. before updating to mountain lion this problem didn't exist.

    after a long in "stop" period, the internet connection (ethernet) doesn't work. before updating to mountain lion this problem didn't exist.

    Gave up on the GUI.  This script derived from http://blog.netnerds.net/2012/07/os-x-how-to-setup-nat-on-lion-and-mountain-lion / seems to work for me:
    gwdev=en0 # This is my WiFi connection (has Internet connection)
    targetdev=en1 # This is the USB to Ethernet adapter (to give Internet connection)
    /sbin/ifconfig $targetdev down
    /sbin/ifconfig bridge0 create
    /sbin/ifconfig bridge0 up
    /sbin/ifconfig bridge0 addm $gwdev
    /sbin/ifconfig bridge0 $HOST_ADDR
    /sbin/route add default -interface bridge0 -ifscope bridge0 -cloning
    /usr/sbin/sysctl -w net.inet.ip.forwarding=1
    /sbin/ipfw add 100 divert natd ip from any to any via $gwdev
    /usr/sbin/natd -interface $gwdev -use_sockets -same_ports -unregistered_only -dynamic -clamp_mss -enable_natportmap -natportmap_interface $targetdev

  • Camera Connection Kit doesn't work

    Hi,
    In 2012 I bought 2 cases for Hyperdrive for my 2nd genreration iPad.  I got drives for both, formatted and used with my iPad with the iPad-USB camera connector (only).  All worked fine.
    Both Hyperdrives went back in their cases and put in the closet 8 months ago and were taken out today for a test run.  Both will turn on and import photos perfectly well.  Neither will establish a connection to my iPad. I initially assumed that I might have a faulty cable and tried a second one that I know is goo, but it too works with neither unit.  As a test of the Hyperdrive units, I tried connecting to my MacBook Pro.  Both work and allow me to see my images in Lightroom.
    Additionally,  until today I had never opened the package that the iPad-SDHC card connector (that  originally came with the iPad-USB connector) was in.  It, too, will not work with my iPad with a good SDHC card in it.  My iPad charger works perfectly well, so I don't think it's the receptor in my iPad.  Until I tried the iPad-SDHC card connector I was beginning to assume it was the iPad-USB connector but I find it odd that a second connector, too, does not work.
    I get no error messages.  Simply, nothing happens at all. Any ideas?
    Thank you.
    Stephanie

    By the way, I have turned the iPad off and back on; I have reset it.
    I have checked and the images are in a DCIM folder.  Each image (they are raw images) has an 8 letter/digit name followed by .raw format code for camera.  Camera is a Panasonic micro four thirds camera.  I've just tried a card from my Canon point and shoot with both RAW and JPEGS on it.  That doesn't work either.

  • Wifi shows connected but doesn't work

    My iPhone 4 shows that it is connected to my home network, but the wifi doesn't work. I know that the router is working because another computer on the network is working fine.

    Try following:
    Delete the WiFi network from your iPhone.
    Disconnect the WiFi router from the power cord, let it be a few minutes, then reconnect.
    Reset the iPhone by holding the Power button and the Home button at the same time, keep holding, ingnore everything on the screen, until you see the white Apple logo, then let go and let the iPhone restart. Set the WiFi t on and put in the password.
    That should do it.

  • Networks connects, but doesn't work

    I work at a hospital and one of our patients has a macbook. We setup a wireless account for him and he connects fine (Sees cisco wap/gets correct ip address), but he can't get to anything. His email client hangs and Safari never connects to the web. I tried pinging, but even that doesn't work. Turning off the enthernet port didn't help. Any suggestions are greatly appreciated.

    I work at a hospital and one of our patients has a macbook. We setup a wireless account for him and he connects fine (Sees cisco wap/gets correct ip address), but he can't get to anything. His email client hangs and Safari never connects to the web. I tried pinging, but even that doesn't work. Turning off the enthernet port didn't help. Any suggestions are greatly appreciated.

  • HTTP Connection KeepAlive doesn't work!

    Hello,<br>
    <br>
    why the KeepAlive-Feature (reusing of TCP-connections, described at http://java.sun.com/j2se/1.5.0/docs/guide/net/http-keepalive.html) doesn't work in the following example? I'm using J2SE 1.4...
    <br>
    <br>
    <br>import java.net.HttpURLConnection;
    <br>import java.net.URL;
    <br>
    <br>public class Test {
    <br>
    <br> public static void main(String[] args) {
    <br> try {
    <br> for (int i=0; i<5; i++) {
    <br> URL url = new URL("http://www.sun.com/");
    <br> HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    <br> conn.setRequestMethod("GET");
    <br> conn.connect();
    <br> conn.getContent();
    <br> conn.disconnect();
    <br> }
    <br> } catch (Exception e) {           
    <br> System.err.println("Exception: "+e.getMessage());
    <br> }
    <br> }
    <br>
    <br>}
    <br>
    <br>
    <br>
    I've checked with Ethereal (http://www.ethereal.com), that 5 different TCP-connections are used, when this example runs.
    <br>
    Where is my mistake??
    <br>
    Does KeepAlive works with MIDP 1.0?
    <br>
    <br>
    Slavik

    may be conn.disconnect(); is closing the underlaying connection.
    Also try putting "Connection: keep-alive" header to the request

  • New ideapad A1000-f won't wifi connect, troubleshooting doesn't work

    still on android 4.1 because can't connect to upgrade the OS. our tv abnd blu-ray connect fine and so do computers.
    Authentication error. it refuses to connect to wifi. tried troubleshooting steps.
    router: linksys E4200 v1.0 1.00.0.5 firmware, encryption set to mixed.
    some strange things are happening:
    when I connect to the 2.4GHz b/g/n connection on my router (mixed mode encryption on a linksys E4200 router, 20MHz channel width,  1.00.05 firmware), it tries to connect and fails with error, the ntries again, etc. passkey is correct. should have easily connected and stayed connected. signal was awful when it should have been great.
    manual connection to 802.11n 5GHz band won't work. it doesn't see the SSID. I have a different SSID for 2.4GHz and 5GHz bands. so I can only assume it's a 2.4GHz 802.11b/g/n only.
    connecting to the guest account somehow gets better signal (why? signal with 2.4GHz is pretty good around the house actually). however it shows as locked and when I connect, it doesn't ask for a passkey. there is a password on the guest account, the default one. connects and drops immediately with error. then reconnects and drops immediately. etc. it should have asked for a passkey. if it knows this somehow because it's a guest account, it should have connected and stayed connected.
    I just need a tablet that works.
    Solved!
    Go to Solution.

    as it turns out, I forgot I had my wifi mac address filtering turned on some time back due to being paranoid because of what I thought was a security issue. disabled it and all was great.

  • IPod Touch 3G Wifi Problem...says it is connected but doesn't work?

    After my iPod connects to a network for wifi, it says that it is connected to that network, and the wifi symbol appears in the top left hand corner to show that it is connected. But, whenever I try to go to Safari or another app involving the internet, the iPod says "invalid argument" and the internet doesn't work at all. How do i fix this problem?

    Have you tried the basic troubleshooting here?
    http://support.apple.com/kb/TS1398
    First try:
    - powering off and then a minute later power back on your router.
    - Reset network settings on your iPod: Settings>General>Reset
    - Resetting youriPod
    http://support.apple.com/kb/TS1398

  • WLS 10.0 JDBC connection pool shrink not working

    We seem to be having a problem with jdbc connection pools not shrinking. In the connection pool properties in the WLS console we have:
    Initial Capacity 4
    Maximum Capacity 15
    Shrink Frequency 900
    However when I look at the underlying xml config file (see below) the last two values above are not present in the config!
    Any ideas what is going on here?
    thankyou,
    Chris
    <?xml version='1.0' encoding='UTF-8'?>
    <jdbc-data-source xmlns="http://www.bea.com/ns/weblogic/90" xmlns:sec="http://www.bea.com/ns/weblogic/90/security" xmlns
    :xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls" xsi:schemaLo
    cation="http://www.bea.com/ns/weblogic/920 http://www.bea.com/ns/weblogic/920.xsd">
    <name>mdmrDataSource</name>
    <jdbc-driver-params>
    <url>jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = xxxrac01-vip.nzlxxx01.com) (PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP) (HOST = xxxrac02-vip.nzlxxx01.com) (PORT = 1521)) (LOAD_BALANCE = yes) (CONNECT_DATA =(SERVE
    R = DEDICATED) (SERVICE_NAME = xxxrac.nzlami01.com)))</url>
    <driver-name>oracle.jdbc.pool.OracleDataSource</driver-name>
    <properties>
    <property>
    <name>user</name>
    <value>xxx_comms</value>
    </property>
    <property>
    <name>fastConnectionFailoverEnabled</name>
    <value>true</value>
    </property>
    <property>
    <name>implicitCachingEnabled</name>
    <value>true</value>
    </property>
    <property>
    <name>connectionCachingEnabled</name>
    <value>true</value>
    </property>
    <property>
    <name>ONSConfiguration</name>
    <value>nodes=xxxrac1:6251,xxxrac2:6251</value>
    </property>
    </properties>
    <password-encrypted>xxx</password-encrypted>
    </jdbc-driver-params>
    <jdbc-connection-pool-params>
    <initial-capacity>4</initial-capacity>
    <test-connections-on-reserve>true</test-connections-on-reserve>
    <test-table-name>SQL SELECT 1 FROM DUAL</test-table-name>
    </jdbc-connection-pool-params>
    <jdbc-data-source-params>
    <jndi-name>jdbc/XXXX</jndi-name>
    <global-transactions-protocol>None</global-transactions-protocol>
    </jdbc-data-source-params>
    </jdbc-data-source>

    You are right that the XML seems to lask those other settings... Did you
    sae those settings from the console?
    This is what's in one of mine....
    <jdbc-connection-pool-params>
    <initial-capacity>0</initial-capacity>
    <max-capacity>300</max-capacity>
    <shrink-frequency-seconds>900</shrink-frequency-seconds>

  • Ethernet Connected - Internet Doesn't Work

    Last night my internet was working perfectly. I was using all of my web applications with ease. I took out my Ethernet cable to plug in to my PC laptop (which worked perfectly than as well), but when I put it back into my iMac this morning- nothing. It recognizes that the computer is connected via Ethernet, but I can't load a page on Safari, Firefox, or sign in to any other internet based program.
    There are two other new iMacs connected by Ethernet and working fine on this network.
    Does anyone know how to solve this issue? It's rather frustrating.
    Thanks

    I have done a Restart on my Mac, as well as a full shut down. I've also reset my router... still nothing!

  • My wifi was disconnected and turned back on. Now my phone either won't connect to the wifi or connects but doesn't work

    My wifi was disconnected and turned back on. Now my phone either won't connect to the wifi or connects but doesn't work

    Reset network settings.
    Settings > General > Reset > Reset Network settings.
    Then re-connect to WifI by setting it up again.

  • My wifi is connected but doesn't work

    The download speeds on my iPhone 4 via wifi dropped from 18+ Meg's to .23 Meg's
    The upload speeds are good at about 7.8 Meg's and holding.
    My phone always shows signal and connection and doesn't
    Disconnect at all. I have had this phone for a year and this issue started the
    Beginning of dec. Is there a seperate transmit and receive antena?
    Any ideas would be great.
    Thanks

    The wifi is connected I've verified this by enabling airplane mode.
    The icon for wifi is on and I can pass limited traffic.
    (see former post). Turned off cellular data and 3G too.
    I get .23 on the download and 7.9 on the upload.
    So I'm pretty sure I'm connected to the wifi access point.
    I'm showing the phones Mac address in the routers arp table too.
    4 laptops, 2 other iPhones and 2 iPod touches all connect to this same
    Access point with speed test results from 10-18 Mbps On the download.
    3-8 Mbps on the upload.

  • Internet connects, but doesn't work properly

    I know there are a lot of topics on this, but mine is pretty specific. I'm using a Macbook I bought last August (Model Identifier MacBook4,1) and running OS 10.5.6 (I can't update to 10.5.7 because I`m having trouble connecting. Recently I noticed a bit of lag between the time my computer appeared to connect to networks via built-in aiport (the airport signal would turn dark in the top right hand corner with and show my signal strength) and when the the computer was actually able to transfer data from the internet (i.e. web pages wouldn't load on browsers and other applications faild to load data and stated there was no connection to the interent). It didn't seem to matter much what network I was logging onto (my home network, my school's, or a wifi hotspot. I'm not great with wireless networking, but I've used macs all my life and and know how to use them very well. I could usually fix the problem by quiting all apps and waiting a few minutes or restarting my computer. I recently arrived in Costa Rica to study abroad, and much to my dismay the problem has worsened. There aren't many places to access the interent here, but the school I am studying at and a cafe have wifi. When I try to connect it my computer has three problems. Sometimes it does't recognize the network even when I am right next to the modem where the signal is strongest. When I search for a network enough times it eventually recognizes the network though. Once I find the network when I click to connect it sometimes starts connecting then just stops before connecting. If I click to connect to the network enough times it eventually connects. When I am supposedly connected it my computer can't trasfer data. When I click on Network Diagnostic it at the Network Settings stage a window pops up stating the Network COnfiguration has changed. The internet the works for a minute or two before once again discontinuing the trasfer of data while inciating I am still connected. I have tried restoring network settings to defaults, but this doesn't change anything. Neither network requires a password. Two fellow students with the same model of MacBooks have been able to connect without problems. We've tried looking at all of my settings and haven't been able to figure out what's wrong. I have a nagging suspicion that my airport card may just be shot. I will be here for most of the summer and I'm pretty sure that my waranty expires while I'm here. There is an Apple store in San Jose about 30 minutes from where I'm staying. So my questions are: 1. Does anyone know how to fix my computer, because I would really like to use it to comunicate with my family? and 2. If it is defective can I take it to the Apple store here even though I purchased it in St. Louis, Mo USA (I've found that my battery is defective already though these forums because only one thread had my specific problem with my battery and all the owner's said that you just have to take it to the Apple store and get a new batter)? If I can't take care of the the defect(s) here is there any way to extend my warrenty for a month until I return to the States without paying to extend the warranty 1-3 years (being a student who's already taking out loans to study abroad I don't have much cash on hand nowdays)?

    Try connecting to a network with an ethernet cable and see how it performs. If that is also not responding this would indicate a possible software error.
    problem with my battery and all the owner's said that you just have to take it to the Apple store and get a new batter)? If I can't take care of the the defect(s) here is there any way to extend my warrenty for a month
    Apple does not cover batteries under warranty as batteries do loose their capacity over time. If a battery suddenly stops working then apple may look into that. You would have to speak to apple care about that.
    You cannot extend a warranty for 1 month you could purchase apple care and get 2 years of extended warranty. Although if the problem is reported to apple care prior to your warranty expiring then you may be ok, but I stress you would have to talk to apple care directly about this.
    Why not take the mac into the apple store I am sure you can make an appointment to see an apple genius anywhere in the world.

  • Please help! connection.rollback() doesn't work for me.

    I have two updates to the database. If either one fails, all the changes should be rolled back.
    I set the auto commit to false before the updates started and invoked rollback() if any exception was caught.
    During the execution of the program, an exception was caught. And one table got updated and the other didn't.
    I can see "TRYING TO ROLLBACK~!!!! ROLLBACK!!!" and "ROLLBACK FINISHED!!!" printed out. But the change made to
    one table did not get rolled back.
    And I tried to call rollback() right after the first update was made. But it didn't rollback the changes made
    to the database.
    Why doesn't the rollback() work?
    Development environment:
    Database:     MySQL Server 4.1
    jdbc driver:      mysql-connector-java-3.1.8
    JDK:          jdk1.5.0_04
              Connection connection = dbConn.getDBConnection();
              String insertDummy1= "insert into dummy1 values(?)";
              String insertDummy2 = "insert into dummy 2 values(?)";
              PreparedStatement psCA = null;
              PreparedStatement psCD = null;
              try {               
                   connection.setAutoCommit( false );
                   psCA = connection.prepareStatement( insertClientAccount );
                   psCA.setString(1, cName);               
                   psCA.executeUpdate();
                   psCA.close();                         
                   // connection.rollback();
                   psCD = connection.prepareStatement( insertClientDetail );
                   psCD.setString(1, cName);               
                   psCD.executeUpdate();               
                   psCD.close();
                   connection.commit();
              } catch(Exception e){
                   if( connection != null ) {
                        try {
                             System.out.println("TRYING TO ROLLBACK~!!!! ROLLBACK!!!");
                             connection.rollback();
                             System.out.println("ROLLBACK FINISHED!!!");
                        } catch(Exception ex) {
                             System.out.println("Exception!! try to roll back >>> " + ex.getMessage() );
                             ex.printStackTrace();
                   processResult = "Failed to complete the process. " + e.getMessage();
                   System.out.println("Exception!! >>> " + e.getMessage() );
                   e.printStackTrace();
              } finally {                                             
                   psCA = null;
                   psCD = null;
                   try{
                        connection.close();
                   } catch(Exception e){
                        System.out.println("Exception!! >>> " + e.getMessage() );
                        e.printStackTrace();
                   return processResult;
              } // try

    In MySQL, there are several different storeage engines/table types. Some of these table tables support transactions (and therefore commit() and rollback() ) and some do not. I believe that if you use a non-transactional table type, it's effectively the same as having autocommit=true (and commit() and rollback() are then silently ignored).
    See:
    http://www.developer.com/db/article.php/2235521
    http://dev.mysql.com/doc/mysql/en/storage-engines.html
    I have used the InnoDB storeage engine and have had no issues with transactionality.

Maybe you are looking for

  • No Video Airplay von iMAC with iTunes

    Airplay on AppleTV2 works good with iPad (Video & Musik), but from iTunes (iMac Lion) only with music; if I try it with a Video I became a window "Timeout to long, check Your NET OR YOUR PREFERENCES" I don´t know, how I can running my video´s from iM

  • AA XI Standard: No "Share" button to simply attach pdf to email without asking for review and comment?

    In AA X, there was a "Share" button which would allow me to attach a copy of the current pdf to an email to be sent out. The pdf wouldn't be for "review" or "comment." Just a plain, vanilla, "Here's a copy of a document." I can't find that capability

  • Kodo Error - plug-in

    Kodo plug-in and JBuilder: If I create one class with absolutely nothing in it except one declaration: private ArrayList test = new ArrayList(); and then compile that class and then right click on the class and select "Create JDO metadata" it success

  • Year 2009 Malaysia Public Holidays set wrongly in SAP calendar Time Mgmt

    Dear Guru, I have a  scenario that the Year 2009 Malaysia Public Holidays for Hari Raya Day 1 and Hari Raya Day 2 has set wrongly in SAP calendar Time Management. Seeking your advice how do I change the Public Holiday dates in the SAP calendar to ret

  • Link "OrgChart" in Who's Who

    In Who's Who (web dynpro version for ERP2004), I want to display Organizational Unit in an employee's detail and I have customized the tables V_T7XSSSERRES and V_T7XSSSERSRV. However the link don't work. If I click on Org Chart link, a new blank page