Unix Technical Forum

to write a big file to sybase db...

This is a discussion on to write a big file to sybase db... within the Sybase forums, part of the Database Server Software category; --> I write a big file size > 130 mbytes to sybase db. But I have error: There is not ...


Go Back   Unix Technical Forum > Database Server Software > Sybase

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-13-2008, 06:14 PM
Bumsys@gmail.com
 
Posts: n/a
Default to write a big file to sybase db...

I write a big file size > 130 mbytes to sybase db. But I have error:
There is not enough procedure cache to run this procedure, trigger, or
SQL batch. Retry later, or ask your SA to reconfigure ASE with more
procedure cache.
I change procedure cash to 1200000, but all the same I have such
error. What to do?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-13-2008, 06:14 PM
Manish Negandhi
 
Posts: n/a
Default Re: to write a big file to sybase db...

On May 13, 1:11*pm, Bum...@gmail.com wrote:
> I write a big file size > 130 mbytes to sybase db. But I have error:
> There is not enough procedure cache to run this procedure, trigger, or
> SQL batch. Retry later, or ask your SA to reconfigure ASE with more
> procedure cache.
> I change procedure cash to 1200000, but all the same I have such
> error. What to do?


How did write a big file to Sybase ? you might want to check what
other activities are going on in the server when you try to write the
file ..

-Manish Negandhi
[TeamSybase]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-13-2008, 06:14 PM
Bumsys@gmail.com
 
Posts: n/a
Default Re: to write a big file to sybase db...

in java I run sql query:
public final void insertFileSybase(final int id, final String folder,
final String filename, final File file, final boolean
isPacked,
final Timestamp lastModified, final Timestamp lastWritten,
final String checkSum, final int backupNo, final int type,
final boolean isDeleted, final int clientId)
throws SQLException, IOException {
// TODO checksum is null
boolean isAUResChecksumColumnExist =
manager.getConnectionInfo()
.isAUResChecksumColumnExist();

int deleted = isDeleted ? 1 : 0;

String query = null;
if (isAUResChecksumColumnExist) {
query = "insert into "
+ getFullTableName(Tables.RESOURCE)
+ " (application_id, backupno, path, name,
contents, last_written, last_modified, packed, checksum, type,
deleted, client_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
} else {
query = "insert into "
+ getFullTableName(Tables.RESOURCE)
+ " (application_id, backupno, path, name,
contents, last_written, last_modified, packed, type, deleted,
client_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
}
logQuery(query);
logQueryParameter("application_id = " + id);
logQueryParameter("backupno = " + backupNo);
logQueryParameter("path = " + makePathToDB(folder));
logQueryParameter("name = " + filename);
logQueryParameter("last_written = " + lastWritten);
logQueryParameter("last_modified = " + lastModified);
logQueryParameter("packed = " + (isPacked ? 1 : 0));
if (isAUResChecksumColumnExist) {
logQueryParameter("checkSum = " + checkSum);
}
logQueryParameter("type = " + type);
logQueryParameter("deleted = " + deleted);
logQueryParameter("client_id = " + clientId);
PreparedStatement ps =
manager.getConnection().prepareStatement(query);
ps.setInt(1, id);
ps.setInt(2, backupNo);
ps.setString(3, makePathToDB(folder));
ps.setString(4, filename);

// TODO long
int len = (int) file.length();
log.info("file: " + file.getAbsolutePath());
if (isDeleted && !file.exists()) {
ps.setNull(5, Types.LONGVARBINARY);
} else if (file.exists() && len == 0) {
ps.setNull(5, Types.LONGVARBINARY);
} else {
InputStream in = new FileInputStream(file);
ps.setBinaryStream(5, in, len);
}

ps.setTimestamp(6, lastWritten);
ps.setTimestamp(7, lastModified);
ps.setInt(8, isPacked ? 1 : 0);
if (isAUResChecksumColumnExist) {
ps.setString(9, checkSum);
}
int typeNumber = isAUResChecksumColumnExist ? 10 : 9;
ps.setInt(typeNumber, type);
int deletedNumber = isAUResChecksumColumnExist ? 11 : 10;
ps.setInt(deletedNumber, deleted);
int clientIdNumber = isAUResChecksumColumnExist ? 12 : 11;
ps.setInt(clientIdNumber, clientId);

int numberOfRows = ps.executeUpdate();
logNumberOfRows(numberOfRows);
ps.close();
}

and when run ps.executeUpdate(), i.e. run sql query and then I have
error: There is not enough procedure cache to run this procedure,
trigger, or
SQL batch. Retry later, or ask your SA to reconfigure ASE with more
procedure cache.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:29 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com