Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > work with sybase...

Reply
Thread Tools

work with sybase...

 
 
Bumsys@gmail.com
Guest
Posts: n/a
 
      05-13-2008
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.
What can do that to solve this problem?
 
Reply With Quote
 
 
 
 
Tim Slattery
Guest
Posts: n/a
 
      05-13-2008
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

>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.
>What can do that to solve this problem?


Sounds like a message that Sybase sent in response to your query.
You'll have to work with your database administrator to get the DB
configured correctly.

--
Tim Slattery
(E-Mail Removed)
http://members.cox.net/slatteryt
 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      05-15-2008
(E-Mail Removed) wrote:
> I run sql query:


> 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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
> }


> 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.
> What can do that to solve this problem?


The errors text is rather clear.

Sybase need to be reconfigured with more procedure cache.

If you ask the DBA he/she should know what it is. And it
need the be fixed - the database is fubar as is.

I am a bit puzzled because you are using straight insert and
not a SP, but maybe there is an insert trigger on the table.

Arne
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE;Kontki if you delete kontiki any program you loaded with it in it 'will not work I have tried it with three programs and none work anymore (if you se it just stop download) 1-Twitch Computer Support 5 04-23-2009 02:45 PM
MS work around on text wrapping in a datagrid does not work TB ASP .Net 2 02-22-2006 10:34 PM
Hi I am new to asp i can not get it to work on xp pro sp2 even though the localhost work but asp pages dont so can some one help craig dicker ASP .Net 9 07-07-2005 11:52 AM
Re: Those cute little "WORK-SAFE" / "NOT WORK-SAFE" tags that people put in the Subject headers of their posts... Soapy Digital Photography 1 08-16-2004 12:07 PM
Re: Those cute little "WORK-SAFE" / "NOT WORK-SAFE" tags that people put in the Subject headers of their posts... Soapy Digital Photography 1 08-16-2004 06:24 AM



Advertisments